The Celebrity Problem: From Brute Force to O(n)
DEV Community
The Celebrity Problem: From Brute Force to O(n)
A beginner friendly walkthrough of the classic Celebrity Problem. We start with the obvious O(n²) approach and end with an elegant O(n) time, O(1) space solution.
0 comments
No comments yet.