Problem

Return how many times target appears anywhere in the 2D array.

Examples

  • countIn2D([[1, 2], [2, 3]], 2) -> 2
  • countIn2D([[0, 0], [0]], 1) -> 0
Compile and test (Ctrl+Enter)