Increment mid point by one while count is equal to k to get the maximum value of mid point
while ( length == k ) : NEW_LINE INDENT if ( length != getCount ( mid + 1 ) ) : NEW_LINE INDENT break ; NEW_LINE DEDENT mid += 1 ; NEW_LINE DEDENT return mid ; NEW_LINE