Ad
  • Default User Avatar

    This is a nice solution, there's a particular pattern for the rules. I solved the problem, but the way I solved it is specific to this problem.

  • Custom User Avatar

    You can fork your own solution and publish an improved version if you feel like :)

  • Default User Avatar

    Just a note for anyone looking at this solution - it does have memory leaks whenever there are still elements in the list at the end of the function. A proper teardown would free each remaining element of the list, but I forgot to do that here.