I\'ve been trying to help someone with this problem for two days now and while I can brute force it with nested for loops, I\'m trying to simplify it