Skip to content

Commit 90e72e8

Browse files
author
changmuk.im
committed
fix : remove wrong conditions
1 parent 628e065 commit 90e72e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

top-k-frequent-elements/EGON.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ final class MaxHeap<T: Comparable> {
88
heapifyUp(from: heap.count - 1)
99
}
1010

11-
@discardableResult
1211
func pop() -> T? {
1312
guard !heap.isEmpty else {
1413
return nil
@@ -84,7 +83,7 @@ struct Item: Comparable {
8483
let count: Int
8584

8685
static func < (lhs: Item, rhs: Item) -> Bool {
87-
return lhs.count <= rhs.count
86+
return lhs.count < rhs.count
8887
}
8988
}
9089

0 commit comments

Comments
 (0)