35 "defaultdict(<class 'int'>, {})"
40 "output_type": "execute_result"
44 "houses = collections.defaultdict(int)\n",
56 "for elf in range(1, target // 10 + 1):\n",
57 " for house in range(elf, target // 10 + 1, elf):\n",
58 " houses[house] += elf * 10"
84 "output_type": "execute_result"
88 "[(h, houses[h]) for h in range(1, 10)]"
104 "execution_count": 6,
106 "output_type": "execute_result"
110 "min(h for h in houses if houses[h] >= target)"
115 "execution_count": 7,
123 "defaultdict(<class 'int'>, {})"
126 "execution_count": 7,
128 "output_type": "execute_result"
132 "houses2 = collections.defaultdict(int)\n",
138 "execution_count": null,
144 "for elf in range(1, target // 10 + 1):\n",
145 " for house in range(1, 51):\n",
146 " houses2[elf * house] += elf * 11"
151 "execution_count": null,
157 "min(h for h in houses2 if houses2[h] >= target)"
162 "execution_count": null,
172 "display_name": "Python 3",
173 "language": "python",
181 "file_extension": ".py",
182 "mimetype": "text/x-python",
184 "nbconvert_exporter": "python",
185 "pygments_lexer": "ipython3",