this is the question: Given a positive integer which fits in a 32 bit signed integer, find if it can be expressed as A^P where P > 1 and A > 0. A and P both should be integers.
I know that I can solve it using brute-force method; however, I am wondering if I could solve it in a better way, or can I solve it using recursion technique? Thanks for your kind help!