Tap here to switch tabs
Problem
Submissions

Problem: Lonely Pixel I

Try to solve the Lonely Pixel I problem.

Statement

Given an m $ imes$ n grid picture consisting of characters 'W' (white) and 'B' (black), return the number of black lonely pixels.

A black pixel is considered lonely if and only if it is the only 'B' in its entire row and the only 'B' in its entire column.

Constraints:

  • m == picture.length

  • n == picture[i].length

  • 1≤1 \leq m, n ≤500\leq 500

  • picture[i][j] is 'W' or 'B'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Lonely Pixel I

Try to solve the Lonely Pixel I problem.

Statement

Given an m $ imes$ n grid picture consisting of characters 'W' (white) and 'B' (black), return the number of black lonely pixels.

A black pixel is considered lonely if and only if it is the only 'B' in its entire row and the only 'B' in its entire column.

Constraints:

  • m == picture.length

  • n == picture[i].length

  • 1≤1 \leq m, n ≤500\leq 500

  • picture[i][j] is 'W' or 'B'.