Skip to content

Commit 62afbe9

Browse files
refactor 422
1 parent a0d03cc commit 62afbe9

File tree

1 file changed

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

1 file changed

+0
-69
lines changed

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

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,6 @@
22

33
import java.util.List;
44

5-
/**
6-
* 422. Valid Word Square
7-
*
8-
* Given a sequence of words, check whether it forms a valid word square.
9-
10-
A sequence of words forms a valid word square if the kth row and column read the exact same string, where 0 ≤ k < max(numRows, numColumns).
11-
12-
Note:
13-
The number of words given is at least 1 and does not exceed 500.
14-
Word length will be at least 1 and does not exceed 500.
15-
Each word contains only lowercase English alphabet a-z.
16-
Example 1:
17-
18-
Input:
19-
[
20-
"abcd",
21-
"bnrt",
22-
"crmy",
23-
"dtye"
24-
]
25-
26-
Output:
27-
true
28-
29-
Explanation:
30-
The first row and first column both read "abcd".
31-
The second row and second column both read "bnrt".
32-
The third row and third column both read "crmy".
33-
The fourth row and fourth column both read "dtye".
34-
35-
Therefore, it is a valid word square.
36-
Example 2:
37-
38-
Input:
39-
[
40-
"abcd",
41-
"bnrt",
42-
"crm",
43-
"dt"
44-
]
45-
46-
Output:
47-
true
48-
49-
Explanation:
50-
The first row and first column both read "abcd".
51-
The second row and second column both read "bnrt".
52-
The third row and third column both read "crm".
53-
The fourth row and fourth column both read "dt".
54-
55-
Therefore, it is a valid word square.
56-
Example 3:
57-
58-
Input:
59-
[
60-
"ball",
61-
"area",
62-
"read",
63-
"lady"
64-
]
65-
66-
Output:
67-
false
68-
69-
Explanation:
70-
The third row reads "read" while the third column reads "lead".
71-
72-
Therefore, it is NOT a valid word square.
73-
*/
745
public class _422 {
756

767
public static class Solution1 {

0 commit comments

Comments
 (0)