Sir, I feel that in the function, instead of if conditions there should be if else condition.
Doubt I the video
hello @vageesha
there is one correction
a)in the first if statement , it should be pre in place of arr[i]
b) if u use if else iif then that is also fine