DEV Community

Discussion on: Interview Qs Decoded - # 1

Collapse
 
lifelongthinker profile image
Sebastian

I think the second 'if' should be an 'else if'.

What if the array given is something like [1,1], meaning there is no second largest integer?

Collapse
 
cat profile image
Cat

Good point! Let me try that out and I'll fix it up. :) Thanks Sebastian!