an n x n grid compose 1 x 1 square 1 x 1 square consist blank space these character divide square contiguous regionsGiven grid grid represent string array return number regionsnote backslash character escape represent Example 1input grid output 2example 2input grid Output 1example 3input grid Output 5explanation Recall character escape refer refer Constraintsn gridlength gridilength1 n 30gridij