How to solve this Photoshoot problem in O(n) ? The best I could come up with is a O(n^2) idea.Would be greatful for some hints.
Help or insight into USACO January 2020 Bronze Problem 2: Photoshoot
How to solve this Photoshoot problem in O(n) ? The best I could come up with is a O(n^2) idea.Would be greatful for some hints.