This problem was asked by Google.
Given a set of closed intervals, find the smallest set of numbers that covers all the intervals. If there are multiple smallest sets, return any of them.
For example, given the intervals [0, 3], [2, 6], [3, 4], [6, 9]
, one set of numbers that covers all these intervals is {3, 6}
.
The solution to this problem will be shared tomorrow with the premium subscribers of the newsletter.
——————————————————————————————————————
Bonuses/Promotion (Get Free Stuff)
To get access to the solution for this problem (and high-quality breakdowns of many other problems), subscribe to the publication right here. Join various other coders nailing interviews at top-tier firms such as Facebook, Microsoft, Google, Fidelity, and more:
To learn how to interview better DM me. Let’s set up mock interviews and go over different interview techniques. In addition to focused questions, and a detailed personalized plan, we will go over the right questions to ask during your interviews.
For one times support of this newsletter. Any amount is appreciated and helps a lot:
Venmo: https://account.venmo.com/u/FNU-Devansh
Paypal: paypal.me/ISeeThings
To share interesting problems/solutions with me, reach out to me. Different social media of mine also have other content from me. Good problems and/or solutions receive a free shoutout + 2 months of the paid newsletter:
Reach out to me on Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/