File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/main/kotlin/g0001_0100
s0023_merge_k_sorted_lists Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ import com_github_leetcode.ListNode
16
16
* }
17
17
*/
18
18
class Solution {
19
- fun mergeKLists (lists : Array <ListNode >): ListNode ? {
19
+ fun mergeKLists (lists : Array <ListNode ? >): ListNode ? {
20
20
return if (lists.isEmpty()) {
21
21
null
22
22
} else mergeKLists(lists, 0 , lists.size)
23
23
}
24
24
25
- private fun mergeKLists (lists : Array <ListNode >, leftIndex : Int , rightIndex : Int ): ListNode ? {
25
+ private fun mergeKLists (lists : Array <ListNode ? >, leftIndex : Int , rightIndex : Int ): ListNode ? {
26
26
return if (rightIndex > leftIndex + 1 ) {
27
27
val mid = (leftIndex + rightIndex) / 2
28
28
val left = mergeKLists(lists, leftIndex, mid)
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ package g0001_0100.s0047_permutations_ii
4
4
// #2023_07_05_Time_199_ms_(100.00%)_Space_39.1_MB_(92.98%)
5
5
6
6
class Solution {
7
- private var ans: MutableList <List <Int >>? = null
7
+ private lateinit var ans: MutableList <List <Int >>
8
8
9
9
fun permuteUnique (nums : IntArray ): List <List <Int >> {
10
10
ans = ArrayList ()
@@ -18,7 +18,7 @@ class Solution {
18
18
for (n in nums) {
19
19
t.add(n)
20
20
}
21
- ans!! .add(t)
21
+ ans.add(t)
22
22
return
23
23
}
24
24
permute(nums, p + 1 )
You can’t perform that action at this time.
0 commit comments