Pergunta de entrevista da empresa Cruise

Given nodes with weights and a set of binary connections between nodes, construct an algorithm that sums the weights of connected nodes for each connection, updates the weight of each node with that sum, and returns the largest weight after realizing each connection.

Resposta da entrevista

Sigiloso

15 de out. de 2017

Brute force [O(n^3), n is number of nodes] approach in python.