using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
List<string> pics = new List<string>();
pics.Add("bbba"); pics.Add("abba") ; pics.Add("acaa"); pics.Add("aaac");
Console.WriteLine("count: " + Solve(pics) );
private static void dfs(List<string> pics, int i, int j, Boolean[,] vis){
if(vis[i,j] == true) return;
if( i < h-1 && pics[i+1][j] == pics[i][j]){
if( j < w -1 && pics[i][j+1] == pics[i][j]){
if( i > 0 && pics[i-1][j] == pics[i][j]){
if(j > 0 && pics[i][j-1] == pics[i][j]){
public static int Solve(List<string> pics){
Boolean[,] vis= new Boolean[h, w];
char currChar = pics[0][0];