This file contains 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
# Write a function word_unscrambler that takes two inputs: a scrambled | |
# word and a dictionary of real words. Your program must then output | |
# all words that our scrambled word can unscramble to. | |
# | |
# Hint: To see if a string `s1` is an anagram of `s2`, split both | |
# strings into arrays of letters. Sort the two arrays. If they are | |
# equal, then they are anagrams. | |
# | |
# Difficulty: 3/5 |
This file contains 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
# Write a function, `rec_intersection(rect1, rect2)` and returns the | |
# intersection of the two. | |
# | |
# Rectangles are represented as a pair of coordinate-pairs: the | |
# bottom-left and top-right coordinates (given in `[x, y]` notation). | |
# | |
# Hint: You can calculate the left-most x coordinate of the | |
# intersection by taking the maximum of the left-most x coordinate of | |
# each rectangle. Likewise, you can calculate the top-most y | |
# coordinate of the intersection by taking the minimum of the top most |