Saturated Range


  • 0
    I

    Is the number range "saturated". I put the word saturated in quotes, because their definition is somewhat ambiguous, after prodding the interviewers, the number range can be fully saturated, over-saturated in certain ranges or under-saturated. Input is a list of ArrayList of 2 integers (each pair represents a range) Input 1: [2,5 | 0,2 | 10,15 | 6,9] Output: Saturated (logically this is over saturated because number 2 occurs twice but not according to the interviewers, creating additional edge cases for your algorithm) Output for the above is, yes the range is "perfectly" saturated because it accounts for all numbers from 0-15. Trick: interviewers consider even though the number 2, which occurs twice to be ok and not over saturated. Input 2: [3,10 | 0,5 | 50,100] Output: "not saturated" ("over saturated", the overlap is more than one number) Note for above range, it is both over saturated and under saturated, but interviewers don't mention/care about this Input 3: [5,9 | 0,3] Output: not saturated


Log in to reply
 

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