Showing 3 of 9 questions
Imagine a tree where some nodes have coins. You want to collect all the coins, but you can only traverse the tree. Find the minimum number of edges you need to travel to collect all the coins.
#1. Collect Coins in a Tree
You have a range of numbered balls to distribute into boxes. A ball goes into a box based on the sum of its digits, so find the box that ends up with the most balls.
#2. Maximum Number of Balls in a Box
Determine if a string containing parentheses is valid. A valid string has matching and properly nested opening and closing parentheses.
#3. Valid Parentheses