8 kyu
Price of Mangoes
8,645 of 32,389AartiK1
Description:
Accountant time! For a given quantity and price (per mango), calculate the total cost of the mangoes.
But! Every third mango is free!
Examples
# π₯ : Paid mango
# π : Free mango
Quantity = 2
Price = 3
Total cost ==> 6
# Paid 2 mangoes for $3 per unit = $6; no mango for free
# π₯π₯
Quantity = 3
Price = 3
Total cost ==> 6
# Paid 2 mangoes for $3 per unit = $6; +1 mango for free
# π₯π₯π
Quantity = 5
Price = 3
Total cost ==> 12
# Paid 4 mangoes for $3 per unit = $12; +1 mango for free
# π₯π₯π π₯π₯
Quantity = 9
Price = 5
Total cost ==> 30
# Paid 6 mangoes for $5 per unit = $30; +3 mangoes for free
# π₯π₯π π₯π₯π π₯π₯π
Fundamentals
Similar Kata:
Stats:
Created | Aug 7, 2016 |
Published | Aug 7, 2016 |
Warriors Trained | 48750 |
Total Skips | 2446 |
Total Code Submissions | 111365 |
Total Times Completed | 32389 |
JavaScript Completions | 10376 |
Python Completions | 8645 |
C# Completions | 1786 |
Ruby Completions | 640 |
Haskell Completions | 320 |
Elixir Completions | 292 |
C++ Completions | 9398 |
Crystal Completions | 17 |
Julia Completions | 54 |
CoffeeScript Completions | 27 |
TypeScript Completions | 543 |
C Completions | 769 |
Scala Completions | 41 |
Dart Completions | 153 |
Swift Completions | 182 |
Java Completions | 345 |
Total Stars | 324 |
% of votes with a positive feedback rating | 89% of 2779 |
Total "Very Satisfied" Votes | 2257 |
Total "Somewhat Satisfied" Votes | 420 |
Total "Not Satisfied" Votes | 102 |