Python One-liner. I feel this shouldn't be possible for a hard question.

  • 0

    return min(set(nums))

    For the preceding question, I used binary search. While I was going to do the same for this one (extending with linear search from mid) and binsearch is technically better (O(lgn) v O(n)), I thought trying this couldn't hurt. Well i guess it did. It hurt my confidence that difficulty assessments are being gauged better. Shouldn't the authors allow this for the "easier" problem or make 3 versions? Just a suggestion

Log in to reply

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