Ad
  • Custom User Avatar

    Thanks I will look into that now!

  • Custom User Avatar

    In that case, you could try using a (circular) linked list in your solution.

  • Custom User Avatar

    Sorry if I am being unclear. I can pass the sample tests but I fail in the attempts when the winning army has more than one soldier with the same shooting speed. So if the winning army originaly had a 55 soldier at both index 0 and index 1, and then the index 1 soldier survived but the index 0 soldier did not, I am still returning index 0 because it is the first in the list I am looking up to and grabbing the surviving 55's index number. I am struggling with how to solve/correct my issue so I was hoping I could find some hints here.

  • Custom User Avatar

    I am currently grabbing the original index from whichever one that appears first in the original list even if it was the second solider who survived.

    It's not entirely clear what you're asking. It sounds like you may be asking if the winning army should return the index of its surviving soldiers in ascending order, but this wouldn't make sense if you're passing the sample tests.

  • Custom User Avatar

    Any hints on how to get the original index numbers for the winning army? I thought I had this solved and passed all tests but when I do attempt I seem to be failing on ones where the winnning army has multiple soliders with the same shooting speed. I am currently grabbing the original index from whichever one that appears first in the original list even if it was the second solider who survived.

  • Custom User Avatar

    this made me chuckle