Ravi Dayabhai & Conrad Warren 🧱 2024-06-21
Consider the following array of 25 squares:
You are filling the array with rectangles by repeating the following two steps:
Ravi Dayabhai & Conrad Warren 🏃 2024-05-03
There are 25 sprinters at a meet, and there is a well-defined order from fastest to slowest. That is, the fastest sprinter will always beat the second-fastest, who will in turn always beat the third-fastest, and so on. However, this order is not known to you in advance.
To reveal this order, you can choose any 10 sprinters at a time to run in a heat. For each heat, you only know the ordinal results, so which runner finishes first, second, third, and so on up to 10th. You do not know the specific finishing time for any runner, making it somewhat difficult to compare performances across heats.
| transaction_id | customer_id | transaction_date | amount | | |
| -------------- | ----------- | ---------------- | ------ | | |
| 653 | 4 | 2019-8-9 | 5800 | | |
| 856 | 15 | 2019-7-26 | 1044 | | |
| 181 | 9 | 2019-7-25 | 1673 | | |
| 923 | 43 | 2019-7-21 | 2238 | | |
| 916 | 34 | 2019-7-22 | 2936 | | |
| 907 | 8 | 2019-8-29 | 5936 | | |
| 25 | 35 | 2019-7-17 | 8273 | | |
| 783 | 37 | 2019-7-3 | 4070 | |
from collections import defaultdict | |
def node(): | |
return defaultdict(node) | |
def word_exists(word, node): | |
if not word: | |
return None in node | |
return word_exists(word[1:], node[word[0]]) |