As per the title, in one of the interview I got the above problem to solve, but i confused to get the answer. Can any one give me the solution please.
Thanks in Advance!
I am expecting solution as per the requirement without using any built in methods available in JavaScript.