We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Greedy
- Greedy Florist
- Discussions
Greedy Florist
Greedy Florist
Sort by
recency
|
787 Discussions
|
Please Login in order to post a comment
Simple Java solution
Java Solution using Priority Queue -> public class Solution {
}
Python 3 - sort desc, caclulate multiplier by flooring the division of flower index and number of friends (this is the "round" of purchase), multiply times price, loop exists at last flower.
I find the most optimal solution of this question :) Just sort the array desc to asc and divide the index with k where u r geeting change in formulae