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
| #refactored to handle negative numbers and duplicates | |
| def second_highest( numbers ) | |
| if numbers[0] > numbers[1] | |
| highest, second_highest = numbers.shift, numbers.shift | |
| else | |
| second_highest, highest = numbers.shift, numbers.shift | |
| end | |
| second_highest = numbers.shift if highest == second_highest |
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
| class Model | |
| attr_reader :deck, :size | |
| def initialize(doc) | |
| @doc = doc | |
| @input = input | |
| @deck = [] | |
| @size = 0 | |
| end | |
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
| Command Line: | |
| Use the up and down keys to scroll through commands that you've recently used. | |
| Use Ctrl-A to go to the beginning of the line | |
| Use cd ~ to get back to the root file | |
| Sublime: | |
| Use Cmnd-B to build right in the editor (Note: use this for syntax only because it doesn't run 1.9). | |
| Use Cmnd-P to find just about anything in sublime including variable and methods. | |
| Use the file structure tab on the right when you want to navigate through the treee. |