Sorry for the sincerity, but how did you get 2 hours stuck to solve this? And another thing, if you didn't have a strong emotional to deal with a simple problem like this, and if you despair, as you hope to work as a programmer, you will go through much bigger problems than this. I'm not saying this to belittle you, but to reflect and train your emotional more to deal with problems.