[Graphs?] Struggling figuring out the algorithm
Task: create the most city road repair plan with the least steps.
Can only repair up to 2 roads at a time.
If road disconnects any of the places it cannot be repaired.
Input in u3.txt side result on the other.

16 Replies
input first row is
city; road counts
then names for cities
and then roads
Either I've forgotten how dfs and bfs algos work or this doesnt use either?
@ἔρωςthis is completely outside my knowledge, but i would say this is something related to graph theory?
Yeah
i know nothing about anything related to this, and i can't tie my shoes
But like Im not sure if this is supposed to be solved like graph theory problems because I think this is highschool level programming competition task
I only learns of graphs in second year of uni 😭
i honestly have no idea, since ive never done anything like this
All good, I've done this several times and Im still clueless whats going on lol XD
Man
I got it somewhat working


solution is technically correct
but the result doesnt match
hmmm I think if i test If the road is repaired already and choose to go down the one that wasnt it should make it as to where my order matches the example data too


@ἔρως Now this you should be able to chime in on 😄 Do these unit tests make sense?
unrepairedcount should be unrepaired roads tho
basically checking if its done in expected amount of turns
and if the unrepaired roads are the same
does it work?
The test?
ye they work
I didnt change the functionality cuz theres a clause saying pick first correct solution so hoping it counts
if it works, it should count