Can somebody help me understand Binary Search Template II
"Template #2 is an advanced form of Binary Search. It is used to search for an element or condition which requires accessing the current index and its immediate right neighbor's index in the array."
I understand what it is doing kinda but what I dont understand is the exact meaning of accessing the current index and its immediate right neighbor. I think without that understanding I wouldnt be able to apply it properly or identify when to use it.
from: https://leetcode.com/explore/learn/card/binary-search/126/template-ii/937/