I would simply say, that Sankar's approach checks only, if the value of each element of array a[] equals the value of the next higher index number. It does not check for all other probable values in a[].