• + 1 comment

    I did something similar. As several others have noted, it's an inefficient approach, but it was really quick to write and handled all the test cases so I considered it fit for purpose.