Doubt doubt doubt

i tried these two programmes:

Kya problem time complexity ki h???

hello @parth_tyagi
which problem u are solving?

find last element -------- recursion challenge.

binary search works only on sorted array,
here array is not sorted

sort kar to diya… Dono programmes me saare test cases clear nahi ho rahe h… work dono kar rahe h…Problem kya h ???

kya hua???

…

a)
u cant sort, sorting will change order hence the index will change too.
that bs logic will never work for this problem

b) in ur other approach. handle if element is not present then print -1