Showing 3 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
Imagine a tree where some nodes have apples. Find the minimum time needed to collect all the apples and return to the root, considering the time to travel each edge.
#2. Minimum Time to Collect All Apples in a Tree
You are given a square matrix representing an image. Rotate the image by 90 degrees clockwise in-place.
#3. Rotate Image