Easy Approach using Log


#1
   A=x^y
   taking log both sides
   log(A)=y.log(x)  // log property
   if(log(A)/log(x)) is integer then true   check (for x=1 to A)
   else false

#2

What if A is negative bruhh, log functions wont work


#3

Yeah, but we don’t have to worry about that here.


#4

Log involves loss of precision in some cases, try to avoid this