Skip to content

Instantly share code, notes, and snippets.

# Better Erros
gem 'binding_of_caller'
group :development do
gem 'better_errors'
end
# Faker Gem
gem 'faker'
# Guard
=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
# 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