Hi errichto ..you probably dont recognize me but i used to write captions for you some 5 years back..good to see you back ...feels like 2019 again 😅
@siddharth-gandhi6 күн бұрын
unfortunate, they should have 2 leaderboards, one for ai and one for humans. thanks for great solutions! always learning new things from your approaches
@ameertaweel92786 күн бұрын
The out degree can be at most the number of characters - 1 (because there can't be a self-edge). It can be less, but can never be more. Therefore the solution you implemented is always better than the alternative you described.
@__Brandon__7 күн бұрын
You can do check if it's in the right order in linear time. Just define a less than comparator to be equal to if the rule (lhs,rhs) exisits in the rules set. Call std::is_sorted using your defined operator. Since checking each element is constant time since you are just checking if the rule exists, checking if everything is sorted is linear. And sorting them into the right order is also trivial, you just call std::sort with your custom less than operator. As long as you are using a stable sort you will get the right solution
@rastislavsvoboda43636 күн бұрын
you are very good, I like watching your videos 14 sec looks crazy anyway, I guess simple bubble sort would do it or custom comparator #python res2 = 0 for bad in B: bad.sort(key=cmp_to_key(lambda p1, p2: -1 if p1 in D and p2 in D[p1] else 0)) res2 += bad[len(bad) // 2]
@michelemattioli2197 күн бұрын
In these two problems there were so many ambiguous things lol
@heinrich75217 күн бұрын
I agree, for part 2 it was never clearly stated that there could be more than 1 wrong ordering in a line of update.
@gala_vs7 күн бұрын
na its ai, a lot of them committed the code to some repo, i am not even trying for lb this year
@mohamedirfan28167 күн бұрын
Yep, the leader-board has lost it's credibility, we don't know who is legit
@anubhabbhattacharya07107 күн бұрын
@@mohamedirfan2816 yes,solving just for fun now
@bladekiller27667 күн бұрын
Yeah now it is pointless to compete for the leaderboard, everyone uses LLMs. But it's funny to me how you give the benefit of the doubt.
@sujals71086 күн бұрын
The reason your assertion initially failed might be because you reached the end of the file so the string 's' didn't end with a newline character. So the index i was going out of bounds.