MCPcopy Create free account
hub / github.com/ByteByteGoHq/coding-interview-patterns / Pair

Class Pair

kotlin/Heaps/KMostFrequentStringsMinHeap.kt:3–3  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import java.util.PriorityQueue
2
3data class Pair(val str: String, val freq: Int)
4
5fun kMostFrequentStringsMinHeap(strs: List<String>, k: Int): List<String> {
6 val freqs = strs.groupingBy { it }.eachCount()

Callers 5

dfsFunction · 0.50
getSlopeFunction · 0.50
widestBinaryTreeLevelFunction · 0.50
maximumsOfSlidingWindowFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected