@Rakshitgarg99, from my experience generally what happens with these type of question is you will be given a function snippet and you have to kind of reimplement the function but there is a catch , the problem is the code that will be provided to you will be complex and inefficient , so your major job is to figure out what is the functionality of that function , i.e what is it doing for that you have to run some test cases and implement that functionality in a optimized way , if implementing the same function as it is will work then there is no point to solve this question