Ad
  • Custom User Avatar

    Not sure what you're doing, but you're not supposed to brute force it. A normal solution should be able to go up to n=100 without taking too long, there's no way you're getting that with O(n ^ 6).

    I'm not sure what the complexity is, but I believe it should be something between O(n ^ 2) and O(n ^ 3).