Tech IndustryJul 19, 2018
QualcommKimjeller

Leetcode question

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

Add a comment
Daimler Ojaidbej Jul 19, 2018

Which problem exactly?

Qualcomm Kimjeller OP Jul 19, 2018

Forgot but I know I got stuck in most medium/hard problems. Do interviewers care about the edge cases?

Uber wyddd Jul 20, 2018

I only care about edge cases, that's where the problem really is

Nielsen pm_me_tc Jul 19, 2018

Don't feel bad. I got stuck at 982/983 on shortest string.

Amazon cspr Jul 19, 2018

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.

Google girlcoder Jul 19, 2018

Print out to console and debug. Copy the test case that failed into "custom test case" so you can run just one case.

Qualcomm Kimjeller OP Jul 19, 2018

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.

Amazon S.Nadella Jul 19, 2018

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.

Intel behn10 Jul 19, 2018

Where does it show the number of test cases for a question?

Qualcomm Kimjeller OP Jul 19, 2018

When you submit a solution and your solution does not pass all the test cases it will tell you.

Microsoft Tier 1 Jul 19, 2018

100% pass rate or gtfo

CA Technologies Amzaon Jul 19, 2018

If you care about your acceptance rate, dont otherwise just try it. Its worth it

New
Catalan5 Jul 19, 2018

I just create a class in ide and debug when stuck like this.