Skip to content

Commit

Permalink
Fixed compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev authored Nov 9, 2023
1 parent 14d9a25 commit bdbe0ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/g0001_0100/s0055_jump_game/Solution.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package g0001_0100.s0055_jump_game

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object Solution {
return minDistance(w2, w1)
}

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

for (j <- 0 to n2) {
dp(j) = j
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MedianFinder() {
private val maxHeap = mutable.PriorityQueue.empty[Int]
private val minHeap = mutable.PriorityQueue.empty[Int](Ordering.Int.reverse)

def addNum(num: Int) {
def addNum(num: Int): Unit = {
maxHeap += num
minHeap += maxHeap.dequeue()

Expand All @@ -24,7 +24,6 @@ class MedianFinder() {
else
(maxHeap.head + minHeap.head).toDouble / 2
}

}

/*
Expand Down

0 comments on commit bdbe0ab

Please sign in to comment.