I like to break down my problem solving into steps. First I understand the task at hand. Second I outline what needs to be done. Third I come up with a working solution and finally I go back and refactor until things are best efficient as far as space and time complexity and legibility.