If you write it and it doesn't finish in a minute, I'm sure it's not that trick.
Somewhere in the instructions it says that your solution should run in less than a minute on ordinary computer hardware. Sometimes it's just as interesting to make your brute force solution more performant as it is to find 'the trick.'
Once you find "the" trick, is there still a lot of computation involved? Do you still write loops? How many orders of magnitude times do those loops run? How do you know when your code is too computationally intensive and you haven't found "the" trick yet?