Skip to content

Commit bdbe0ab

Browse files
authored
Fixed compile warnings
1 parent 14d9a25 commit bdbe0ab

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/main/scala/g0001_0100/s0055_jump_game/Solution.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package g0001_0100.s0055_jump_game
66

77
object Solution {
88
def canJump(nums: Array[Int]): Boolean = {
9-
var sz = nums.length
9+
val sz = nums.length
1010
// We set tmp to 1 so it won't break on the first iteration
1111
var tmp = 1
1212

src/main/scala/g0001_0100/s0072_edit_distance/Solution.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object Solution {
1414
return minDistance(w2, w1)
1515
}
1616

17-
var dp = Array.range(0, n2 + 1)
17+
val dp = Array.range(0, n2 + 1)
1818

1919
for (j <- 0 to n2) {
2020
dp(j) = j

src/main/scala/g0201_0300/s0295_find_median_from_data_stream/MedianFinder.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MedianFinder() {
1010
private val maxHeap = mutable.PriorityQueue.empty[Int]
1111
private val minHeap = mutable.PriorityQueue.empty[Int](Ordering.Int.reverse)
1212

13-
def addNum(num: Int) {
13+
def addNum(num: Int): Unit = {
1414
maxHeap += num
1515
minHeap += maxHeap.dequeue()
1616

@@ -24,7 +24,6 @@ class MedianFinder() {
2424
else
2525
(maxHeap.head + minHeap.head).toDouble / 2
2626
}
27-
2827
}
2928

3029
/*

0 commit comments

Comments
 (0)