Skip to content

Commit 605a981

Browse files
refactor 533
1 parent 756a543 commit 605a981

File tree

1 file changed

+0
-34
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-34
lines changed

src/main/java/com/fishercoder/solutions/_533.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,6 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
/**
7-
* 533. Lonely Pixel II
8-
*
9-
* Given a picture consisting of black and white pixels, and a positive integer N,
10-
* find the number of black pixels located at some specific row R and column C that align with all the following rules:
11-
12-
Row R and column C both contain exactly N black pixels.
13-
For all rows that have a black pixel at column C, they should be exactly the same as row R
14-
The picture is represented by a 2D char array consisting of 'B' and 'W', which means black and white pixels respectively.
15-
16-
Example:
17-
Input:
18-
[['W', 'B', 'W', 'B', 'B', 'W'],
19-
['W', 'B', 'W', 'B', 'B', 'W'],
20-
['W', 'B', 'W', 'B', 'B', 'W'],
21-
['W', 'W', 'B', 'W', 'B', 'W']]
22-
23-
N = 3
24-
Output: 6
25-
Explanation: All the bold 'B' are the black pixels we need (all 'B's at column 1 and 3).
26-
0 1 2 3 4 5 column index
27-
0 [['W', 'B', 'W', 'B', 'B', 'W'],
28-
1 ['W', 'B', 'W', 'B', 'B', 'W'],
29-
2 ['W', 'B', 'W', 'B', 'B', 'W'],
30-
3 ['W', 'W', 'B', 'W', 'B', 'W']]
31-
row index
32-
33-
Take 'B' at row R = 0 and column C = 1 as an example:
34-
Rule 1, row R = 0 and column C = 1 both have exactly N = 3 black pixels.
35-
Rule 2, the rows have black pixel at column C = 1 are row 0, row 1 and row 2. They are exactly the same as row R = 0.
36-
37-
Note:
38-
The range of width and height of the input 2D array is [1,200].
39-
*/
406
public class _533 {
417
public static class Solution1 {
428
/**

0 commit comments

Comments
 (0)