TopcoderArchiveVisit Topcoder
Archive
Algorithm problem

PerfectPower

Problem statement, definition, constraints, and public examples.

Problem Statement

A perfect power is a number such that it can be represented in the form "a
raised to the b power", where both a and b are positive ints GREATER THAN 1.
Create a class PerfectPower that includes a method isValid(int) that takes an
int as an argument and returns a boolean indicating whether the argument was a
perfect power. For example, your method should return true for 4, 8, 9, 16, 25,
27... and return false for all values in between. Here is the method signature: 

boolean isValid(int input);

Definition

Class:
PerfectPower
Method:
isValid
Parameters:
int
Returns:
boolean
Method signature:
boolean isValid(int param0)
(be sure your method is public)

Constraints

    Examples

      No public sample cases were explicitly marked for this problem in the original data.

      Back to all problems