Serial NO: Problems
Serial NO: Problems
1 https://leetcode.com/problems/top-k-frequent-elements/description/
2 https://leetcode.com/problems/group-anagrams/
3 https://leetcode.com/problems/find-all-anagrams-in-a-string/description/
4 https://leetcode.com/problems/permutation-in-string/description/
5 https://leetcode.com/problems/sort-characters-by-frequency/description/
6 https://leetcode.com/problems/kth-largest-element-in-an-array/description/
7 https://leetcode.com/problems/top-k-frequent-words/description/
8 https://leetcode.com/problems/k-closest-points-to-origin/description/
9 https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/
10 https://leetcode.com/problems/valid-palindrome/description/
11 https://leetcode.com/problems/3sum/description/
Week-1
12 https://leetcode.com/problems/container-with-most-water/
13 https://leetcode.com/problems/maximum-tastiness-of-candy-basket/description/
14 https://leetcode.com/problems/trapping-rain-water/
15 https://leetcode.com/problems/candy/description/?envType=study-plan-v2&envId=top-interview-1
16 https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/?envType=stud
17 https://leetcode.com/problems/gas-station/?envType=study-plan-v2&envId=top-interview-150
18 https://leetcode.com/problems/zigzag-conversion/description/?envType=study-plan-v2&envId=top
19 https://leetcode.com/problems/longest-substring-without-repeating-characters/description/
comments
you can solve it using heap. But better TC with Bucket sort
using charMap as key + sliding window
using charMap + sliding window
using charMap + sliding window
using charMap. Sort charMap in descreasing order then use stringbuilder for returning result
u can solve it using minHeap but better TC - quickSelect Algorithm
dict + maxHeap
maxHeap becoz it needs closest point means min values need to be preseved
two pointer logic with prefix, suffix array. Do the trick with just two variables maxLeft, maxRight
using prefix array. Make sure when moving from right, you consider only maxLeft or right+1.
better approach would be using peak-valley algo
keep tracking element until count<3. reset count to 1 when element mismatch
total given gas should not be less than total given cost. If total gas negative, reset it to 0