Nothing here yet.
Nothing here yet.
Nov 4, 2021 · 2 min read · 215. Kth Largest Element in an Array First Step is to Implement min-heap using go package "container/heap". You can copy their Len,Less,Swap,Push,Pop function from their example(IntHeap) section right away. type minHeap []int func (h minHeap) Len()...
Join discussionNov 4, 2021 · 2 min read · 31. Next Permutation Example Case : [2,3,6,5,4,1] Algorithm Step1 from right to left, find the first number which not increase in a ascending order. In this case which is 3. Step2 here we can have two situations: We cannot find the number, all the...
Join discussionNov 4, 2021 · 2 min read · Problem 3. Longest Substring Without Repeating Characters Algorithm: Maintain a hashmap which stores the characters(asci value) in string as keys and their positions as values. var seen = map[byte]int{} Note: as we know string is just slice of byte...
Join discussion