Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Start from the beginning of the array <code>nums.at(0)</code>.
Do a binary search on the last index <code>last</code> such that <code>nums.at(0) == nums.at(last)</code>.
Continue this process until you get to the end of the array (<code>nums.size()</code>).