<gouthampradhan>dynamic_programming_StoneGameIV_2.java
private void genSquare(int sq, int limit, Set<Integer> perfectSquare) {
    if (!perfectSquare.contains(sq)) {
      perfectSquare.add(sq);
      if (((long) sq * sq) <= limit) {
        genSquare(sq * sq, limit, perfectSquare);
      }
    }
  }
private void sample_funcname ( int sq , int limit , Set < Integer > perfectSquare ) {
  if ( ! perfectSquare . contains ( sq ) ) {
    perfectSquare . add ( sq ) ;
    if ( ( ( long ) sq * sq ) <= limit ) {
      genSquare ( sq * sq , limit , perfectSquare ) ;
    }
  }
}
