All Indices Problem

Hello, I am trying to solve this problem and I am not passing one test case. Please check and tell me where am I getting it wrong.
Problem link: https://online.codingblocks.com/app/player/79595/content/88835/4915/code-challenge

My code: https://ide.codingblocks.com/s/231928

@Ibrahim while calling your function you have passed n-1 so it is not checking for the last index
here is the correct code

1 Like

Thank you for the help.