Skip to content

Commit be174de

Browse files
committed
Fixed compile warning
1 parent 54d9eb8 commit be174de

File tree

1 file changed

+3
-4
lines changed
  • src/main/kotlin/g3501_3600/s3509_maximum_product_of_subsequences_with_an_alternating_sum_equal_to_k

1 file changed

+3
-4
lines changed

src/main/kotlin/g3501_3600/s3509_maximum_product_of_subsequences_with_an_alternating_sum_equal_to_k/Solution.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ class Solution {
1111
return prod * 31 + parity
1212
}
1313

14-
override fun equals(obj: Any?): Boolean {
15-
if (obj !is StateKey) {
14+
override fun equals(other: Any?): Boolean {
15+
if (other !is StateKey) {
1616
return false
1717
}
18-
val other = obj
1918
return this.prod == other.prod && this.parity == other.parity
2019
}
2120
}
@@ -96,7 +95,7 @@ class Solution {
9695
}
9796
val bs: BitSet = entry.value
9897
if (targetIdx >= 0 && targetIdx < size && bs[targetIdx]) {
99-
answer = max(answer.toDouble(), key.prod.toDouble()).toInt()
98+
answer = max(answer, key.prod)
10099
}
101100
}
102101
return answer

0 commit comments

Comments
 (0)