I’ve been solving problems on leetcode from last couple of weeks or so and there is one thing about this platform that is really really frustrating which is NO CONSTRAINTS IN THE PROBLEMS
I always do problems looking at the constraints in codeforces, atcoder, codechef, hackerearth etc. Many times I write solution spending my time and suddenly there’s one test case where it fails like empty array or something which is still fine but not giving any constraints of the input absolutely at all make me slam my head on desk.
Today I was solving a hard problem and write the dp code for it in 35-40 mins. it passed all my test cases which I thought back then and then suddenly it gave me wrong answer because there were negative values in the array (-_-)
I mean i knew my logic would failed for negative values but only if they had written the constraints like a[i] can be negative, my 35-40 mins wouldn’t have been wasted in writing the flawed code.
I know its a good platform, no doubt about that but has anyone faced the similar issue while solving problems there?