Why this approach for finding last occurrence of an element failing for array inputs like: 1,2,3,4,2
Last Occurrence using binary search
This is because you need to have a sorted array for this, thts why ,
1 Like