Panda Guru LogoPanda
Guru

Amazon | Phone | SDE II | USA

Round 1

Questions: I have an empty crossword puzzle represented as a 2D matrix. Unavailable squares are marked as "B" and available as "W". A word can be placed horizontally or vertically and can be any length (including 1).

Write a function that tells me how many places I can put words. For each word, if you can, also give me their coordinates.

Example:

crossword = [ ["B", "B", "B", "B", "B"], ["B", "W", "W", "B", "B"], ["B", "W", "B", "B", "B"], ["B", "W", "W", "B", "B"], ["B", "B", "B", "B", "B"] ]

Your solution should return 10. 5 of length 1 2 horizontal of length 2 2 vertical of length 2 1 vertical of length 3

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.