Founding Batch Offer · HLD · LLD · System Design at ₹799 until 30 Nov

ProgramsLogic building

Phase 4 - Level 5: Logical & Applied

Apply array logic to solve complex problems.

14 programs · open one, then the next

Start with Check if Array is Sorted (Ascending)
  1. 01Check if Array is Sorted (Ascending)AdvancedCheck nondecreasing order in a list by comparing neighbors. Students use a boolean flag, stop on the first inversion, and understand how ties are handled.Open example →
  2. 02Check if Array is Sorted (Descending)AdvancedCheck nonincreasing order in a list with adjacent comparisons. Students identify the first upward step and see why descending order can include equal neighbors.Open example →
  3. 03Find Second LargestAdvancedFind the second distinct largest value in a list. Students skip every maximum, track a nullable candidate, and distinguish distinct rank from sorted position.Open example →
  4. 04Find Second SmallestAdvancedFind the second distinct smallest list value with Python. Students exclude all copies of the minimum and use None until a valid replacement candidate appears.Open example →
  5. 05Range (Max - Min)AdvancedCalculate a list's numerical range as maximum minus minimum. Students guard empty input and distinguish this statistical range from the range iterator.Open example →
  6. 06Sum Except Max & MinAdvancedSum list entries after excluding one maximum and one minimum. Students trace totals and see why repeated extreme values are not all removed by subtraction.Open example →
  7. 07Count Pairs with Sum KAdvancedCount unordered index pairs whose values add to a target. Students trace nested bounds and avoid counting a pair twice or pairing an element with itself.Open example →
  8. 08Count Elements Greater Than AverageAdvancedCount values strictly above a list's average. Students compute the mean first, scan again for matches, and identify empty input as an undefined case here.Open example →
  9. 09Frequency of Distinct ElementsAdvancedPrint a count for each distinct integer in sorted order with Python. Students combine a frequency dictionary, a set of keys, and numeric ordering for display.Open example →
  10. 10Unique Elements OnlyAdvancedRemove repeated list values while preserving first appearances in Python. Students pair a set for membership with a result list for stable output order.Open example →
  11. 11Find Kth Largest ElementAdvancedSelect the kth largest list position with Python sorted. Students validate a one-based rank, convert it to an index, and retain repeated values as ranks.Open example →
  12. 12Rotate Array by K PositionsAdvancedRotate a list right by k positions using slices. Students normalize the count, join the wrapped suffix and prefix, and handle zero-sized input before modulo.Open example →
  13. 13Find Missing Number in SequenceAdvancedFind one missing value from one through n using sums. Students trace the triangular-number formula and see the exact input assumptions behind subtraction.Open example →
  14. 14Find Duplicate ElementAdvancedFind a duplicate by subtracting expected and actual sequence sums. Students examine a shortcut that depends on every value from one through n being present.Open example →