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
| # Better Erros | |
| gem 'binding_of_caller' | |
| group :development do | |
| gem 'better_errors' | |
| end | |
| # Faker Gem | |
| gem 'faker' | |
| # Guard |
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
| =begin | |
| Given an array of positive integers, find all pairs that have a difference of a specified value k. | |
| Pass: O(n^2) | |
| Super Extra Credit: O(n) | |
| =end | |
| # O(n^2) Solution |
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
| # have a phone number to letter group mapping | |
| TELEBET = ["0", "1", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"] | |
| # all completed mnemonics will be saved here | |
| @mnemonic_list = [] | |
| # recursive method | |
| # ARGUMENTS: | |
| # number is the string of digits | |
| # digit is the current digit being added to the mnemonic, initially set to 0 |