This is the problem-solving pattern I follow for solving coding challenges. I learned this flow from my bootcamp curriculum at Springboard.
1. Read the problem. Can I restate the problem in my own words?
2. What are the inputs? What data types can I expect here?
3. What is my expected output and its data type?
4. Do I have enough information to solve the problem? Do I need to ask any more clarifying questions?
5. How am I going to label the important pieces of data that go into the problem?
6. Can I run though a simple example of the problem in my own words?
7. How about a more complex example?
8. How am I going to handle empty/invalid inputs?
9. Write my pseudocode. Does this reveal anything else I don't understand about the problem?
10. What's the core difficulty? Is there a simpler problem I can solve?
11. Using my debugging tools, what am I seeing? What hypotheses can I form about why my code is not working, and how can I test them?
12. Does my result match my expected output, or do I need to do type coercion of some sort?
13. Can I improve the O(n) of my solution?
14. Are my tests still passing? Can I write more?