← BNY Mellon questions
CodingReported in a candidate post, Aug 2023

Sum of Distances

Filed under BNY Mellon

Given an undirected tree with node values, shuffle the values such that no node retains its original value. Calculate the minimum and maximum possible sum of distances between initial and final…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related BNY Mellon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.