6 kyu

Basket of Fruits

Description:

There are 6 types of fruits in the basket: Apples, Pears, Oranges, Lemons, Bananas and Tomatoes.
Your task: given a total number of fruits as an argument (always positive), return the highest possible number of Bananas, while following ALL the rules below:

There are 17 more Oranges than Apples.
There are 40% less Pears than Oranges.
There are 5/6 more Lemons than Pears.
There are 3x less Apples than Bananas.

There might be some Tomatoes left in the basket after you sort them (we dont want the Tomatoes, people think they are vegetables and it gets confusing).
If there are not enough total fruits to follow the rules, return "false".
All fruits must ALWAYS be counted as whole numbers.

Mathematics
Puzzles

More By Author:

Check out these other kata created by madars

Stats:

CreatedOct 22, 2017
PublishedOct 22, 2017
Warriors Trained554
Total Skips20
Total Code Submissions832
Total Times Completed104
JavaScript Completions104
Total Stars13
% of votes with a positive feedback rating78% of 29
Total "Very Satisfied" Votes20
Total "Somewhat Satisfied" Votes5
Total "Not Satisfied" Votes4
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • madars Avatar
  • ZED.CWT Avatar
  • XoRMiAS Avatar
  • LosBlobbos Avatar
Ad