Skip to content

Commit ccd6300

Browse files
authored
Improved tasks 1713, 2306
1 parent 8d0716e commit ccd6300

File tree

2 files changed

+2
-4
lines changed
  • src/main/kotlin
    • g1701_1800/s1713_minimum_operations_to_make_a_subsequence
    • g2301_2400/s2306_naming_a_company

2 files changed

+2
-4
lines changed

src/main/kotlin/g1701_1800/s1713_minimum_operations_to_make_a_subsequence/Solution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Solution {
2020
return target.size - longestIncreasingSubsequence(list)
2121
}
2222

23-
private fun longestIncreasingSubsequence(list: MutableList<Int?>): Int {
23+
private fun longestIncreasingSubsequence(list: List<Int?>): Int {
2424
val n = list.size
2525
var l = 0
2626
val arr = IntArray(n)

src/main/kotlin/g2301_2400/s2306_naming_a_company/Solution.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ class Solution {
2525
res += compare(b1, b2)
2626
}
2727
}
28-
2928
return res
3029
}
3130

32-
fun compare(b1: MutableSet<String>, b2: MutableSet<String>): Long {
31+
fun compare(b1: Set<String>, b2: Set<String>): Long {
3332
val set1 = if (b1.size > b2.size) b1 else b2
3433
val set2 = if (b1.size > b2.size) b2 else b1
3534
var n1 = set1.size
@@ -40,7 +39,6 @@ class Solution {
4039
n2--
4140
}
4241
}
43-
4442
return (n1 * n2) * 2L
4543
}
4644
}

0 commit comments

Comments
 (0)