File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
src/main/kotlin/g3201_3300
s3286_find_a_safe_walk_through_a_grid
s3288_length_of_the_longest_increasing_path Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class Solution {
16
16
val bfs: Queue <IntArray ?> = LinkedList <IntArray >()
17
17
bfs.add(intArrayOf(0 , 0 , health - grid[0 ][0 ]))
18
18
visited[0 ]!! [0 ][health - grid[0 ][0 ]] = true
19
- while (! bfs.isEmpty ()) {
19
+ while (bfs.isNotEmpty ()) {
20
20
var size = bfs.size
21
21
while (size-- > 0 ) {
22
22
val currNode = bfs.poll()
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Solution {
38
38
return longestIncreasingLength(upper) + longestIncreasingLength(lower) + 1
39
39
}
40
40
41
- private fun longestIncreasingLength (array : MutableList <IntArray >): Int {
41
+ private fun longestIncreasingLength (array : List <IntArray >): Int {
42
42
val list: MutableList <Int ?> = ArrayList <Int ?>()
43
43
for (pair in array) {
44
44
val m = list.size
@@ -52,7 +52,7 @@ class Solution {
52
52
return list.size
53
53
}
54
54
55
- private fun binarySearch (list : MutableList <Int ?>, target : Int ): Int {
55
+ private fun binarySearch (list : List <Int ?>, target : Int ): Int {
56
56
val n = list.size
57
57
var left = 0
58
58
var right = n - 1
You can’t perform that action at this time.
0 commit comments