File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
g1701_1800/s1713_minimum_operations_to_make_a_subsequence
g2301_2400/s2306_naming_a_company Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments