Solutions and tests for code katas
Where my anagrams at? (5th kyu)
- Module:
where_my_anagrams_at.py
- Tests:
test_where_my_anagrams_at.py
- URL: challenge url
Summarize ranges (6th kyu)
- Module:
summarize_ranges.py
- Tests:
test_summarize_ranges.py
- URL: challenge url
No zeros for heros (8th kyu)
- Module:
no_zeros_for_heros.py
- Tests:
test_no_zeros_for_heros.py
- URL: challenge url
Scrabble best word (6th kyu)
- Module:
scrabble_best_practices.py
- Tests:
test_scrabble_best_practices.py
- URL: challenge url
Pairing brackets (6th kyu)
- Module:
pairing-brackets.py
- Tests:
test_pairing-brackets.py
- URL: challenge url
Paul's Misery (7th kyu)
- Module:
pauls_misery.py
- Tests:
test_pauls_misery.py
- URL: challenge url
Proper Parenthetics
- Module:
parenthetics.py
- Tests:
test_parenthetics.py
- URL: challenge url
- Notes: I used the stack data structure on this problem. I decided to rebuild it instead of using what we'd built this week because I wanted extra practice. I solved a similar kata on Day of Code without using the stack (Pairing Brackets), and I think this solution is a lot more robust and interesting.
String Pyramid
- Module:
string_pyramid.py
- Tests:
test_string_pyramid.py
- URL: challenge url
- Notes: I used string formatting to produce the pyramid side view and learned some new parameters. I would like to refactor my pyramid above view to be more performant and elegant. I used ternary operators to calculate the stone counts.
Sort a Deck of Cards
- Module:
sort_cards.py
- Tests:
test_sort_cards.py
- URL: challenge url
- Notes: I used a pared-down version of a priority queue data structure built in partnership with Chris Hudson to sort a deck of cards. I used numeric values of cards as a priority and created a dictionary of face cards as keys with priorities as their values.
Find the unique string
- Module:
unique_chars.py
- Tests:
test_unique_chars.py
- URL: challenge url
- Notes: My solution uses the remove method to elimate spaces and converts each string to a set as it is iterated cover to ensure duplicate characters are eliminated.
Running Average
- Module:
running_average.py
- Tests:
test_running_average.py
- URL: challenge url
- Notes: I developed two solutions, one with a class containing a call method and another with a local data collection and function.
Original Number
- Module:
original_number.py
- Tests:
test_original_number.py
- URL: challenge url
- Notes: I created a list of single characters that were ordered. My solution iterates through the list, counts the occurrences of each character, appends a numeric character to a list, then deletes the letters of an entire word for as many counts of the character there were. Finally, the list of numeric characters is sorted and turned into a single string.
Backwards Read Primes
- Module:
backwards_prime.py
- Tests:
test_backwards_prime.py
- URL: challenge url
- Notes: After exploring various sieve solutions to identify prime numbers, I utilized the following code to determine whether a given number was prime (https://stackoverflow.com/questions/18833759/python-prime-number-checker)
Multiples of 3 and 5
- Module:
sum_three_five.py
- Tests:
test_sum_three_five.py
- URL: challenge url
- Notes: My solution concatenates two list comprehensions, with one containing all the multiples of three and and the other multiples of five under the parameter number. The concatenated list is converted to a set to remove duplicate numbers that have both three and five as factors, and then the set is summed.