Hello coders i would like to share a problem solving stratergy that is somewhat popular and was helpful to me and also used by my friends .
I want to highlight the fact that when we learned time complexity for the first time we were never told for what input size which time complexity is suitable.
If you are not aware of that you are simply left guessing and trying out various time complexities on problems .
Here i want to provide a clear mapping of running time and input sizes they can handle so you don't waste time thinking of a solution that was sure to get timed out.
Size of Input -> Worst accepted algorithm
Reference--> https://www.hackerearth.com/practice/basic-programming/complexity-analysis/time-and-space-complexity/tutorial/
So what do I mean by this table I mean that when I see constraints in problem like N>10^4 immeditaly it rings me the bell that i need something at least O(n*logn) or O(n) even better.
If i see n<1000 i am extra sure that my nested for loop solution is in right track.
Same for other problems if i see N<=100M I quickly remove the thought of sorting and start thinking of some way to store past results.
By the way the hands down best resource for binary search -https://algo.monster/problems/binary_search_intro
Thank me later
I know you always can get idea with tags but in like online assesment this might be fruitful .
I know this might not be new to some but it might be for some others.