I noticed that I often overcomplicate problems, hence my codes are often very long and I lose precious time during contests.
70077990 I wrote a sliding window minimum, but it wasn't necessary since $$$O(n^2)$$$ is fast enough with those constraints.
79841706 I found a solution that required too much memory. My "optimization" is 90 lines long. That problem can be solved in 30 lines.
79880987 I used a dfs and a 0-1 bfs (120 lines), a single bfs was enough.
Overall, I find difficult to improve a solution that seems already feasible.
Could you give some advice about how to stop overcomplicating problems?