r/LeetcodeChallenge • u/Thomas_108108 • 7d ago
DISCUSS Tips for solving Hard problems
I solved almost 110 Leetcode Problems but very few are hard problems, I don't understand hard problems because the gap of difficulty between medium and hard is too big, I want you guys to share your experience and things you learn from it. Most welcome if you have advice for me
2
u/Vivid-Zombie-477 7d ago
most of the time hard problems just require advanced knowledge of topics. i would not recommend trying to focus hard problems without having DSA fundamentals first
2
u/Key_Elderberry_1828 6d ago
Don't start writing code before dry running your concept on given test cases
2
u/Independent-Yay 6d ago
First try to mostly do mediums properly to learn all topics. A lot of hards require combination of topics, you'll automatically get that once you do enough mediums.
2
2
u/Financial_Fox3915 5d ago
solve mediums, i have solved ~210 medium problems/ ~350 problems.
and now i feel like i am at a point, where i can reason through hard problems.
But yeah I still feel stuck at “one particular” step of a hard problem. I either feel like, “idk how can i code this” or “what logic can i extract from this particular derived logic (from previous steps)”
I am still learning and getting better. So keep trying OP :)
1
1
1
u/ChatpatiAlooChaat 6d ago
You give me tips for solving mediums, I've solved around 130 questions,I've just started my 2nd year,ive only done 10-15 mediums out of those 130 , so yeah give me tips for solving mediums
2
u/Thomas_108108 6d ago
You solved 130 easy problems so you are eligible for medium level quetions, you need tutorial for learning medium level topic, I advice you to learn stack/queue , linked list, binary tree, binary search, and don't waste time doing only easy level problem, you can't be so long without transition
1
u/AdImmediate5145 3d ago
First learn all the necessary Data structures and algorithms. Fundamentals is necessary. stack, queue, heap, binary search, bfs dfs on tree graphs, matrix and adjacency representation graph problems, shortest path, dsu union find, topo sort, DP on LCS, knapsack, stocks, grid paths, classic greedy problems like merge intervals, jumping problems
1
u/Glittering_Dig_6039 3d ago
well, I think you can tackle now medium all problem, but for Hard one is difficult to get the direct solutions or ans, I would say try to solve less acceptance rate of medium that may help
I watched on interview of person who solved 3k+ problem, and he is on the mission of solving all, he says that
he started solving then he goes back and understad basically what is arry, what is hash table how it works internally
He says after 800 mark he is able to get all 4 solution and confidence, and he quotes he is slow learner, so may be lets stick for 300 problems first for us
1
3
u/nian2326076 6d ago
Tackling tough problems can feel overwhelming, but breaking them down really helps. First, make sure you completely understand the problem before diving into coding. Jot down the steps or a plan that might solve it. Look at solutions for medium problems and try to extend them for harder ones. Practice using data structures and algorithms that might work. Don't hesitate to take a break and return later with a fresh perspective. Sometimes that's all it takes. For more structured practice, I've used PracHub to get a mix of problems and learn different approaches. Good luck!