If i comment out the line in your solution(line 33):
heappush(maxStartHeap, (topStart, startIndex))
I still get the right output
Can you please give an example where this is absolutely necessary?
Course: Grokking the Coding Interview: Patterns for Coding Questions - Learn Interactively
Lesson: Solution Review: Problem Challenge 1 - Grokking the Coding Interview: Patterns for Coding Questions