Skip to main content

1D Array ✔

danger

Solve 4, 5.1, 5.2, 6 in different days

danger

Solve 8, 9 in different days

  1. Find X
  2. Lower Bound
  3. Upper Bound
  4. Search Insert Position
    1. 03 April, 2026: 00.03.14 ✔
      • For duplicates, use iteration even after finding correct answer
      • If not found require valid index, use left, even after iterating the array it not found, that means the answer is n, and left become n after increment.
      • If not require -1 index, then use helper variable.
  5. Floor/Ceil
    1. 03 April, 2026: 00.01.55 ✔
  6. First and Last Occurences
    1. 03 April, 2026: 00.01.21 ✔
  7. Count Occurences
  8. Search in Rotated Sorted
    1. 03 April, 2026: 00.22.26 ❌
      • Approach was right
      • Assume only left array sorted, right array can also be sorted
  9. Search in Roated Sorted II
    1. 03 April, 2026: 00.22.26 ❌
      • Failed at edge case
        • Handle the case when left, mid, right are equal
  10. Minimum in Rotated Sorted Array
    1. 03 April, 2026: 00.17.47 ❌
      • Approach was right
        • Keep repeating same mistake
        • Use left/right = mid +/- 1 when mid is not in the answer, but use left/right = mid when mid is in the answer
        • When you are already pointing left/right=mid, no need to check left==right as it could be fail if left==right==mid
  11. Count rotation
  12. Signle Element
    1. 03 April, 2026: 00.15.45 ❌
      • approach was right
        • implement the even, odd approach what you exactly thinking, compare mid, before mid, after mid
  13. Find Peak Element
    1. 03 April, 2026: 00.44.51 ❌
      • Failed at impmentation
        • Find out which slope you are in
        • if you're on an increasing slope, a peak must exist on the right side, becasuse if it's keep increasing eventually it fails as after the last item, its count -1
        • if you're on an decreasing slope, a peak must exist on left side and so on