We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If it makes you feel better I tried it, and it has array index out of bound exception. Just revisit it and you'll see. And once again it's clear even without trying. You start at i=0 and you are trying to access item at i-1 which is index -1
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Array
You are viewing a single comment's thread. Return to all comments →
If it makes you feel better I tried it, and it has array index out of bound exception. Just revisit it and you'll see. And once again it's clear even without trying. You start at i=0 and you are trying to access item at i-1 which is index -1