Showing 3 questions
Two players play a game on a special type of tree called a Fibonacci tree. Determine if the first player can win by strategically removing subtrees, one at a time.
#1. Subtree Removal Game with Fibonacci Tree
The problem asks you to find how many pairs of numbers in an array are equal. Each index can only be part of one pair.
#2. Number of Good Pairs
You're given an array representing weights. Implement a function to randomly pick an index from the array, where the probability of picking each index is proportional to its weight.
#3. Random Pick with Weight