Upper bound and lower bound works differently why?

  1. https://ide.codingblocks.com/s/259309
    here upper bound and lower bound runs perfectly and (it-a) also gives the index

  2. but here i don’t know what is happening why (it-a) works differently ?? https://ide.codingblocks.com/s/259302

why is that difference ??

hello @anujsharmabadboy
lower bound and upper bound works only on sorted array.
so give sorted input and it will work as usual

bhai thank u bohot time se dimag lga rha tha