When solving Programmers problems, there are occasionally some where the test cases fail even though the solution seems perfect. Then I spend a really long time thinking about why it is wrong and try to fix it. When it fails, I search on Google to see if I can find cases where people with similar ideas to mine made the same mistake and got them wrong. However, if there are no people who made a similar mistake, I ask a question, and if I feel that I cannot solve it, I look at the answer and move on to another problem. I really want to know where in the process of my reasoning I went wrong, but that is not easy.
**What should I do when I don’t know what counterexample there might be for the part where I went wrong? **
- Should I completely erase my code and start from scratch?
- Should I look at the answer?
- Should I ask a question?