solve the problem of remove the Nth From the end