Problem Β· Math
Arrange Coins π
Learn this problemProblem statement
Given an array of integers coins, where each element represents the number of coins. For each number of coins, output the maximum number of rows that can be stacked, with the stacking rule being: the first row contains one coin, the second row contains two coins, and so on.
Function
arrangeCoins(coins: int[]) β int[]Examples
Example 1
coins = [3, 4, 6]return = [2, 2, 3]No explanation for now..