Alice has a collection of gardens represented by an integer array flowers, where flowers[i] denotes the number of flowers currently planted in the newFlowers flowers that she can plant across any of the gardens. She can plant any number of additional flowers in each garden, provided the total number of newly planted flowers does not exceed newFlowers.
A garden is defined as complete if it contains at least target flowers. Otherwise, it is considered incomplete.
The total beauty of the gardens is calculated as the sum of:
The number of complete gardens multiplied by full
The minimum number of flowers among all incomplete gardens multiplied by partial
If there are no incomplete gardens, the second term contributes
Return the maximum possible total beauty Alice can achieve.
Constraints:
flowers.length
flowers[i], target
newFlowers
full, partial
Alice has a collection of gardens represented by an integer array flowers, where flowers[i] denotes the number of flowers currently planted in the newFlowers flowers that she can plant across any of the gardens. She can plant any number of additional flowers in each garden, provided the total number of newly planted flowers does not exceed newFlowers.
A garden is defined as complete if it contains at least target flowers. Otherwise, it is considered incomplete.
The total beauty of the gardens is calculated as the sum of:
The number of complete gardens multiplied by full
The minimum number of flowers among all incomplete gardens multiplied by partial
If there are no incomplete gardens, the second term contributes
Return the maximum possible total beauty Alice can achieve.
Constraints:
flowers.length
flowers[i], target
newFlowers
full, partial