Quick Overview

Given a rooted multiway tree as a parent array, return the minimum explicit subtree deletions needed to keep every remaining node within a maximum depth while preserving the root.

Prune a Multiway Tree to a Maximum Depth

Company: Snowflake

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Given a rooted multiway tree as a parent array, return the minimum explicit subtree deletions needed to keep every remaining node within a maximum depth while preserving the root.

Loading…