2. Printing subsequence #

Created Saturday 04 January 2020

All subsequences

Print Keypad: Step

  1. try some example, 23 9 possiblilites.
  2. As this is like a subsequence, except for the fact that we have toPut.size() number of problems, and not a simple inclusion/exclusion.
  3. We will prefer %10 rather than storing up a divider(10^r). This decides toPut, which will surely be prepended to the output.
  4. 234, as an example can be written as f(234,"")= f(23, toPut(i)+""). The recurrence relation. Maybe we can escape using memoization. But that is just storing, busted.
  5. Base case: When we get num==0(num and not a digit okay, they are different), just print the output.

Keypad Problem