Google SWE Phone Screen | L3

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-05-19Added By Anonymous
Source: Link

Company: Google
Role: L3
Interview Stage: Phone Screen
Location: unknown
Year: unknown

Original Post Content:

Q) We are given a 2D grid of characters. Count the number of non-overlapping square subgrids that meet these conditions:

1) A square is any k x k region (with k ≥ 1) of the same character.

2) The entire square must be made of only that character.

3) No cell in a square should be connected to any same-letter cell outside the square (no same-letter leakage).

4) No overlapping: Once a cell is used in a square, it cannot be reused.

I was asked this problem today but sadly was not able to code the full solution but it was fun. Is there any similar problem available on leetcode?

Comments