Ad
  • Custom User Avatar

    If there are an equal number of naughty and nice it should return 'naughty'. In the example you provided there is 1 naughty ('broke...') and 1 nice ('got...') while the other 2 don't fit the pattern. Without seeing your code I can't offer suggestions but it worked for me in Ruby.

  • Custom User Avatar

    Language?

    Also, are you sure you are not modifying the initial array?