//Instead of using the classic recursive approach i.e. x*pow(x, n-1) just have (x*x), i.e., pow(x*x, n/2). //This will make the TC logarithmic instead of linear. //Just take care of the edge cases ...
Each topic lives under src/main/java. Topic and problem packages are numbered in source-list order while remaining Java-valid. Each problem starts with BruteForce.java; add additional approach classes ...