@@mihaimanole2643 it could be selected like that specifically, or by random chance that the script works on the selected input. I had a day where I had a bug in my code, and it worked on the input of 2 friends, but not on my input.
Great video! Love how concise your code is. In my attempt (TypeScript, not Python, so not sure how different it would be), I put the fallback alongside the other rules (instead of tracking it differently), and I assign it null. Then, when I'm checking all the rules, I check "if (!rule)", in which it case I return true. So in that sense, you can treat the fallback part of the string as yet another rule (that always comes out to true).
Your code in the video has different definitions of T and F than the code on your github. For instance T = (lo, n-1) in the video, is replaced with the (in my view more correct) T = (lo, min(n-1, hi)) on github. But both versions of code seem to return the same total on the input data! (I can not see why that is though?)
I had it little more chatty and prepended condition as "" before fallback node def count_accepted(intervals, node, G): if node == "A": v = 1 for i_s, i_e in intervals: if i_s
At part2 in for in rules, first if cmp = “
Interesting. You're correct; I'm surprised that doesn't cause any issues. I fixed the code in the repository; thanks for mentioning this.
@@hyper-neutrino Could be that the input from AoC to be selected in the way that those cases to not happen?
@@mihaimanole2643 it could be selected like that specifically, or by random chance that the script works on the selected input.
I had a day where I had a bug in my code, and it worked on the input of 2 friends, but not on my input.
Super cool. I'm still crunching through a few of the last remaining days but part 2 really got to me. Nice explanation :)
It looks so easy when you do it...👍
Great video! Love how concise your code is. In my attempt (TypeScript, not Python, so not sure how different it would be), I put the fallback alongside the other rules (instead of tracking it differently), and I assign it null. Then, when I'm checking all the rules, I check "if (!rule)", in which it case I return true. So in that sense, you can treat the fallback part of the string as yet another rule (that always comes out to true).
Such a clean code, well done
crazy
Nicee
Your code in the video has different definitions of T and F than the code on your github. For instance T = (lo, n-1) in the video, is replaced with the (in my view more correct) T = (lo, min(n-1, hi)) on github. But both versions of code seem to return the same total on the input data! (I can not see why that is though?)
See the pinned comment
I had it little more chatty
and prepended condition as "" before fallback node
def count_accepted(intervals, node, G):
if node == "A":
v = 1
for i_s, i_e in intervals:
if i_s