2936. Number of Equal Numbers Blocks
ArrayBinary SearchInteractive
Hints
Hint 1
Start from the beginning of the array
nums.at(0).Hint 2
Do a binary search on the last index
last such that nums.at(0) == nums.at(last).Hint 3
Continue this process until you get to the end of the array (
nums.size()).Preparing judge…