Function to check whether its k root is an integer or not
static boolean check ( long no , int k ) { double kth_root = nthRoot ( no , k ) ; long num = ( long ) kth_root ; if ( Math . abs ( num - kth_root ) < 1e-4 ) return true ; return false ; }