Runtime vs Edge Cases


  • 0
    W

    I see many questions for which I give an optimized solution containing a check for edge cases well before I implement my actual algorithm. Their runtime averages around 15ms. After my solution is accepted, I see other solutions preferably those whose runtime is less than mine. I noticed that many of those solutions skip the testing for edge cases. (for example, checking for an empty array or null strings as input)
    Is testing/checking for edge cases not important (specifically when preparing for interviews)?
    Should runtime be given more preference over edge cases?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.