Last active
August 29, 2015 14:20
-
-
Save samuelcole/1d73da2d45290c558906 to your computer and use it in GitHub Desktop.
Insert or move an object to the front of the list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# given a set of shows that the user is going to | |
going = [c, e] | |
# and a set of shows that are available | |
available = [a, b, c, d] | |
# 1. insert the going shows at the beginning of the array | |
# 2. make sure the same show doesn't appear twice | |
list == [c, e, a, b, d] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment