โ† Samsung questions
CodingMedium

Count subtrees with digit sum k

Filed under Samsung

The question

Given a tree and integer k, return the count of subtrees where every node's value's digit sum equals k.

No write-up yet. Related questions below have one.

Related Samsung questions

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