#include using namespace std; int min(int a,int b,int c) { int min = a; if(min > b) min = b; if(min > c) min = c; return min; } int main() { const int size = 5; char a[size][size] = { {'b','b','b','b','w'},{'b','b','b','b','b'},{'b','b','b','b','b'},{'b','b','w','b','b'},{'b','w','w','b','b'} }; int arr[size+1][size+1]; // First row and First column of arr is zero. for(int i=0;i answer) answer = arr[i+1][j+1]; } } } for(int i=0;i