Week 1
Week 1
Day 1: Arrays
1. Easy:
o Find the second largest and second smallest elements in an array./ kth largest
element in an array.
2. Medium:
o Find the majority element in an array (appears more than n/2 times).
3. Hard:
Day 2: Strings
1. Easy:
o Reverse words in a given string (e.g., "I love coding" → "coding love I").
2. Medium:
3. Hard:
1. Easy:
o Sort an array of 0s, 1s, and 2s without using extra space (Dutch National Flag
Problem).
2. Medium:
3. Hard:
o Find the smallest window in an array that must be sorted to make the entire array
sorted.
o Find all pairs in an array whose sum is equal to k (using sorting and two-pointer
approach).
1. Number System:
o Find the ratio of two numbers when their product and sum are given.
3. Miscellaneous:
Solve a mixed bag of 8-10 questions from the topics above, such as:
1. Find the longest palindromic substring (Strings).