Skip to content

Commit 772db5c

Browse files
committed
leetcode
1 parent 8287d98 commit 772db5c

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

DeleteColumnsToMakeSorted/delete_columns_to_make_sorted.go

-29
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,3 @@ func isSorted(strs []string, col int) bool {
4343
}
4444
return true
4545
}
46-
47-
/*
48-
49-
int minDeletionSize(List<String> strs) {
50-
int deleted = 0;
51-
if (strs.length == 0) return deleted;
52-
int rowSize = strs[0].length;
53-
54-
for (int col = 0; col < rowSize; col++) {
55-
if (!isSorted(strs, col)) deleted++;
56-
}
57-
58-
return deleted;
59-
}
60-
61-
bool isSorted(List<String> strs, int col) {
62-
int N = strs.length;
63-
int prev = 0;
64-
for (int i = 0; i < N; i++) {
65-
int c = strs[i].codeUnitAt(col);
66-
//If out of order
67-
if (c < prev) return false;
68-
//update prev
69-
prev = c;
70-
}
71-
72-
return true; //In order the whole time
73-
}
74-
*/

0 commit comments

Comments
 (0)