Count Nodes With the Highest Score at DoorDash

Medium52.5% acceptance

This problem has 62.5% frequency at DoorDash.

Problem Description

There is a **binary** tree rooted at `0` consisting of `n` nodes. The nodes are labeled from `0` to `n - 1`. You are given a **0-indexed** integer array `parents` representing the tree, where `parents[i]` is the parent of node `i`. Since node `0` is the root, `parents[0] == -1`. Each node has a **s...

Read full problem and hints

Topics

Also asked at 2 companies


More DoorDash Questions

View all DoorDash questions