Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
The key insight/ intuition (non-obvious) is that- if you did a worked example fi...

Will

May 31, 2022

The key insight/ intuition (non-obvious) is that- if you did a worked example first- you'd find that the heap always contains ONLY 1 element from each list/ row array. The heap NEVER contains 2 or more elements from the SAME list.

This is important because it means that the range calculated at every iteration is always guaranteed to be a range that has exactly 1 element from every single list!

I think the description lacks this key detail, as it's just asserted that the stated solution works but it's not immediately obvious that it should.

12

0

Comments
Comments
Design Gurus
Design Gurus3 years ago

Thanks for the comment. This looks quite relevant, we should be including it in the solution description.