#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

vector<int> getVisionPattern1d(){
    return {1, 1, 2, 1, 2, 2};
}

int getMove1d(vector<int> v){
    int mid = (v.size()-1)/2;
    if(v[mid] == 1){
        if(v[mid+1] == 2 && v[mid-1] == 1){
            return mid+1;
        }else if(v[mid+1] == 1 && v[mid-1] == 2){
            return mid-1;
        }else if(v[mid+1] == 2 && v[mid-1] == 2){
            return mid+1; /// vse taq
        }
    }else if(v[mid] == 2){
        int leftNum = v[mid-1]*10 + v[mid-2];
        int rightNum = v[mid+1]*10 + v[mid+2];
        if((leftNum == 11 && rightNum == 12) || (leftNum == 12 && rightNum == 11)){
            return rightNum==12 ? mid+2 : mid-2;
        }else if((leftNum == 12 && rightNum == 21) || (leftNum == 21 && rightNum == 12)){
            return rightNum==21 ? mid+2 : mid-2;
        }else if((leftNum == 21 && rightNum == 11) || (leftNum == 11 && rightNum == 21)){
            return rightNum==11 ? mid+2 : mid-2;
        }
    }
    return 0;
}

vector<vector<int>> getVisionPattern2d(){
    return {{1}};
}

pair<int, int> getMove2d(vector<vector<int>> v){
    return {0, 0};
}
