𓁟 host1.bitchan.one

𓀐 @Y399s4F6: >https://everybody.codes/events ETA 29 hours Discuss what programming language you will use NO AI ALLOWED

What's the smart way to solve it? The logic I think is necessary is: Every alloy ID should have a list of alloy IDs that are weaker than it. For every pair of alloys N and M, where N is stronger than M, update list N to include alloy M, update any list K that includes N to also include M, update any list J that includes K to also include M, repeat as necessary. Is there a simpler way to do it?

⧖expiring ~26d0/2 kept4d ago

𓀐 @cqNbz~Mu

⏱ 5d 👍 0

⬆ upvote 0

[⇥] sort oldest ⏱
filter [-]
𓀐 @uaoCQYyo: mine solution was basically: >make a dict where the key is the allow and the value is a list of alloys known to be weaker than it >make a list of all alloys >find the alloy that isn't in any other alloy's "weaker than" list >that's the strongest >now iterate through the list again, ignoring the strongest alloy, to find the other alloy not in anyone's list >that's the second strongest alloy >keep iterating til you've assigned them all probably a faster way of doing it, but it's pretty simple conceptually+

⬆ upvote 0↩ reply 0