Updated first_larger_index method to take care of empty array case