Skip to content

Array Problems

This document lists all array problems from the DSA Notes & Problems repository, organized by file and difficulty level.


  1. Array_problems.js
  2. Array_problems1.js
  3. Array_problems2.js

#ProblemTopicsFile
1Two SumHash Map, Two PointersArray_problems.js
2PalindromeTwo Pointers, String ReversalArray_problems.js
3Reverse StringString Manipulation, Two PointersArray_problems.js
4Merge Sorted ArrayTwo Pointers, MergingArray_problems.js
5Valid ParenthesesStack Data StructureArray_problems.js

Key Concepts:

  • Hash Map for O(n) lookups
  • Two Pointer technique
  • Stack-based validation

#ProblemTopicsFile
1Remove Duplicates from Sorted ArrayTwo Pointers, In-place modificationArray_problems1.js
2Left Rotate Array by OneArray ShiftingArray_problems1.js
3Left Rotate Array by K PlacesReversal AlgorithmArray_problems1.js
4Move Zeros to EndTwo PointersArray_problems1.js
5Rotate Array (Right Rotation)Reversal AlgorithmArray_problems1.js

Key Concepts:

  • In-place array manipulation
  • Rotation algorithms (forward & reverse)
  • Two pointer technique for reordering

#ProblemTopicsFile
1Find the Largest Element in ArrayLinear ScanArray_problems2.js
2Find the Minimum Element in ArrayLinear ScanArray_problems2.js
3Find the Second Largest ElementSingle PassArray_problems2.js
4Find the Nth Largest ElementSortingArray_problems2.js
5Find the Nth Minimum ElementSortingArray_problems2.js
6Check if Array is SortedLinear ScanArray_problems2.js

Key Concepts:

  • Linear scanning techniques
  • Sorting for selection problems
  • Min/Max tracking patterns

ProblemBestAverageWorst
Two Sum (Hash)O(n)O(n)O(n)
PalindromeO(1)O(n)O(n)
Merge SortedO(n+m)O(n+m)O(n+m)
Remove DuplicatesO(n)O(n)O(n)
Rotate ArrayO(n)O(n)O(n)
Find LargestO(n)O(n)O(n)
Find Nth LargestO(n)O(n log n)O(n log n)

  • Find the Largest Element
  • Find the Minimum Element
  • Check if Array is Sorted
  • Two Sum
  • Palindrome
  • Merge Sorted Array
  • Remove Duplicates
  • Move Zeros to End
  • Rotate Array (K Places)
  • Valid Parentheses
  • Find Second Largest
  • Find Nth Largest/Minimum

  • Data Structures: Arrays, Hash Maps, Stacks
  • Techniques: Two Pointers, Hash Maps, Sorting, Reversal, Linear Scan
  • Concepts: In-place modification, O(1) space complexity, O(n) time complexity
  • Patterns: Min/Max tracking, Merging, Rotation, Validation

Total Problems: 16
Total Approaches Covered: 25+
Recommended Practice Order: Array_problems2.js → Array_problems.js → Array_problems1.js