Ad
  • Default User Avatar

    yep! you can do repeat = arr[0] at line 3 and remove the else! nice one!

  • Default User Avatar

    I enjoyed working with your solution. I found yours to be faster than mine for two reasons. I noticed your use of repeat to represent arr[0]. using this rather than arr[0] in the loop really reduced the time. I also found that a for loop using range is also faster than a while loop. I have a minor question. Why not assign repeat to arr[0] before the if statement? Anyway I really enjoyed working with your code solution.