Build the Largest Available Sequence | Amazon Coding Question