Practice this Hard Arrays coding problem from Harness.
Pattern: 2 DSA
You are given an undirected weighted tree consisting of n servers numbered
…
Given an array of values, determine the required result under the following conditions.
Input: [4, 8, 15, 16, 23, 42]
Output: 3
Constraints: 1 ≤ n ≤ 10⁵
Unlock the full statement, examples, constraints, and solution guidance.
Run code to see test results
Harness • Pending