This is an interview question from google. I am not able to solve it by myself. Can somebody shed some light?
Write a program to print the sequence of keystrokes suc
Here's how I would approach it:
given some text, it takes 4 keystrokes to duplicate it:
From there, you can consider doing 4 or 5 A's, then looping through the above. Note that doing ctrl + a, c, v, v will grow your text exponentially as you loop through. If remaining strokes < 4, just keep doing a CtrlV
The key to interviews @ places like Google is to state your assumptions, and communicate your thinking. they want to know how you solve problems.