Balance a graph by adding stones so adjacent nodes differ by at most one.
Unlock detailed company stats for this questionUpgrade
Given a connected graph where every node has some number of stones, balance the graph by adding stones so that no two adjacent nodes differ by more than one stone. I approached it with BFS starting from the nodes with the most stones, using a max heap to process the highest-stone node first.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
