Distinct-Subsequences

This is a famous problem from dynamic programming. Any solution in CPP or Java is welcomed.