Find the optimum sequence of keyboard hits to produce the most repeated characters -


you provided 4 possible operations can done on editor (each operation requires one keyboard hit).

  1. a
  2. ctrl+a
  3. ctrl+c
  4. ctrl+v

now can hit keyboard n times , need find maximum number of a's can printed. print sequence of keyboard hits.

googled answer:

http://podlipensky.com/post/2011/02/07/sundays-puzzle.aspx


Comments