TikTok code interview
Anonymous User
1473

I got this coding question in my interview. Which leetcode problem is close to this?

You are given a grid m*n, in which each cell has value 'x' as pebbles or 'o' as empty cell. Return the maximum number of pebbles you can collect given any of the follwoing conditions is hold (that mean if only one condition is held it is ok):

  1. There remains at least one pebble in the row you are picking up from.
  2. There remains at least one pebble in the column you are picking up from.

example:
x x
x o

return 2 : that is taking 'x' at (0, 1) and (1, 0)

Comments (2)