Logic doubt in 1st and last occurance binary search program

what does ans = -1 ; in the code signify in this code why did’nt we take ans=0 instead???

hello @rastogi.g1998
-1 signifies element is not found.

we didnt take 0 ,because 0 can be a possible answer.