Find the Minimum and Maximum Number of Nodes Between Critical Points

Solution Code
Video GuideLeetcode Daily

Time Complexity

O(n)

Space Complexity

O(1)