๐ฆ Array Problems
Welcome to the Array section of JDCodebase! Arrays are one of the most fundamental and frequently used data structures in programming. Most DSA problems begin here.
Learning how to manipulate and traverse arrays is essential for becoming a strong problem-solver. Master key concepts and strengthen your foundation with these curated problems.
๐ง What Youโll Learn
- Basics: Traversal, insertion, deletion
- Prefix sums, difference arrays, and window-based patterns
- Sorting, searching, and optimizations with pointers
- Pattern recognition like frequency counts, merging, etc.
๐ ๏ธ Useful JavaScript Methods
arr.push(val)
โ add at endarr.pop()
โ remove from endarr.shift()
,arr.unshift(val)
โ front operationsarr.slice(start, end)
โ get subarrayarr.splice(index, count)
โ remove or insertarr.includes(val)
,arr.indexOf(val)
arr.sort()
,arr.reverse()
๐ Problems List
- Two Sum (#1)
- Find Numbers with Even Number of Digits (#1295)
- Concatenation of Array (#1929)
- Build Array from Permutation (#1920)
- Shuffle the Array (#1470)
- Kids With the Greatest Number of Candies (#1431)
- Squares of a Sorted Array (#977)
- Two Sum II - Input array is sorted (#167)
- Merge Sorted Array (#88)
- Move Zeroes (#283)
- Remove Duplicates from Sorted Array (#26)
- Remove Element (#27)
- Sort Colors (#75)
- Shortest Distance to a Character (#821)
- Sort Array by Parity (#905)
- Contains Duplicate II (#219)
- Longest Harmonious Subsequence (#594)
- Maximum Average Subarray I (#643)