a problem may seem complicated, and attempting to code immediately can only exacerbate the situation. the best approach is to grab a pen and paper, and brainstorm. then go for the brute force approach. after achieving the result ask chatgpt to improve the code and learn from it.