Easy Approach using Log

   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


What if A is negative bruhh, log functions wont work


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


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