When solving LC problems do you keep changing your code until all test cases have passed?? There’s problems with 800+ tests and am stuck at 790. Do you just move on to next problem or stick to it? I spent two hours solving one medium/hard problem. Lol
Don't feel bad. I got stuck at 982/983 on shortest string.
After a certain amount of time (usually an hour) I generally would browse the discussion section and try to scan the code, looking for whatever edge case or area of logic I missed.
Print out to console and debug. Copy the test case that failed into "custom test case" so you can run just one case.
It’s tiring to do these for each of the last 5-10 corner cases I haven’t thought about. Or Maybe I just need more practice or I suck.
Try to anticipate edge cases before you write the code. In a real interview you won't be able to compile and run against test cases someone else wrote for you.
Where does it show the number of test cases for a question?
When you submit a solution and your solution does not pass all the test cases it will tell you.
100% pass rate or gtfo
If you care about your acceptance rate, dont otherwise just try it. Its worth it
I just create a class in ide and debug when stuck like this.
Which problem exactly?
Forgot but I know I got stuck in most medium/hard problems. Do interviewers care about the edge cases?
I only care about edge cases, that's where the problem really is