How long should I struggle with a DSA problem before checking the solution?
I'm practicing data structures and algorithms, especially sliding-window problems, but I sometimes spend two or three hours trying to find a solution. How can I tell whether I'm…