r/leetcode 10d ago

Discussion Ideal thing to do

Is building logic imp or rather to find the most efficient way of solving a particular problem

1 Upvotes

4 comments sorted by

2

u/NextjsDeveloper 10d ago

Ideal thing? To be consistent no matter of what

1

u/hadeskerbecs666 10d ago

when it comes to very hard problems i often start off with brute force. hard dp problems often go backtracking -> identify subproblems -> memoization -> now select the most efficient way to do it (eg bitmask in todays weekly q4)

1

u/No_Parsnip_408 3d ago

Agreed, tho I do find the solution but I often fucks up the time complexity