posted 2 years ago
once added limit it worked with for loop also
i am not that used using more than one indexes. can we do this with just one index instead of 2 indexes(one to iterate given input index to check each element, other to put elements into result array to display finally)?