← ALL NOTES
Array

3212. Count Submatrices With Equal Frequency of X and Y

Given a grid of characters 'X', 'Y', and '.'. Count the submatrices that contain the top-left corner (0,0), have at least one 'X', and where the count of 'X' equals the count of 'Y'.

Loading…