Find last element

one test case is not running

hello @2018kucp1041
Initialise ur k with -1.
this is done to handle the case when target element is not there in the array.