𓁟 host1.bitchan.one

+⧖>https://everybody.codes/events ETA 29 hours Discuss what programming language you will use NO AI ALLOWED >https://everybody.codes/events ETA 29 hours Discuss what programming language you will use NO AI ALLOWED
𓀐 @cqNbz~Mu: 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?

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

⧖expiring ~11d0/1 kept4d ago

𓀐 @uaoCQYyo

⏱ 5d 👍 0

⬆ upvote 0