Numbered messages arriving on server


  • 0
    R

    Messages objects are sent out and arrive on a server. The messages are numbered from [ 0 , n ]. The messages arrive in a random manner.

    Write a method that takes in a number and returns the list from [ 0, to number passed in ] if all messages from [ 0, to number passed in ] have arrived on the server. If all messages from [ 0, to number passed in ] have not arrived, return null.

    What would be some optimal solutions for this problem?


Log in to reply
 

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