cpp implementation of Remove Nth Node From End of List