MKJUMPS. What is the problem in this solution?

#include <bits/stdc++.h>
using namespace std;
int arr[10][10];
int visited(int r,int c,int n,int col)
{
if(r<0||r>n||c<0||c>col||arr[r][c]==2||arr[r][c]==0)
return 0;
arr[r][c]=2;
return 1+max(max(visited(r-2,c-1,n,col),max(visited(r-2,c+1,n,col),max(visited(r-1,c-2,n,col),visited(r-1,c+2,n,col)))),max(visited(r+1,c-2,n,col),max(visited(r+1,c+2,n,col),max(visited(r+2,c-1,n,col),visited(r+2,c+1,n,col)))));
}
int main() {
int n;
cin>>n;
memset(arr,0,sizeof(arr));
int count=0;
int col=INT_MIN;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{

     cin>>arr[i][j];
    count=arr[i][j]?count+1:count;
}}

cout<<count-visited(0,0,n-1,n-1);
return 0;
}

Please share the link to the problem
And also what error is it showing on submitting.

Thanks @sss. Now, i have done it on my own.