6 kyu
Kata 2019: Combine Fruits
159 of 197myjinxin2015
Loading description...
Algorithms
Performance
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
python new test framework is required. updated in this fork
Approved
Python fork
(No idea why but this causes a description change due some difference in whitespace)
Superceded by fork above :(
C++ translation (author is inactive)
Python 3.6 should be enabled.
Done
I just don't understand this challenge. I am not allowed to add the numbers if they are adjacent but on the tests we have the 2 pile example: [1, 2] and the 3 pile example [1, 2, 9] where the 1 and 2 are adjacents and were added. Can you please explain a little better?
description said,
May not be adjacent
. It means that two number can be any two piles. adjacent or not. I'll update the description later. Thanks ;-)description updated.
Thank you very much for the update and your fast response, but there is still something that I am not understanding. In the example 3, how did you get to 111? If I sum everything as you did on example 1, I get 113. Could you please explain what am I doing wrong? Here is the example: 6 Piles: 4 3 5 6 10 20 4 + 3 = 7 (7 Energy) 5 Piles: 7 5 6 10 20 7 + 5 = 12 (12 Energy) 4 Piles: 12 6 10 20 12 + 6 = 18 (18 Energy) 3 Piles: 18 10 20 18 + 10 = 28 (28 Energy) 2 Piles: 28 20 28 + 20 = 48 (48 Energy) 1 Pile: 48
Sum of all the energy consumed would be: 7 + 12 + 18 + 28 + 48 = 113. Right?
Perhaps not. ;-) For example, second step can be
5+6
, instead of7+5
I am suprised this person can write a kata when the second line is grammaticly incorrect english.
This comment has been hidden.
Third line... and more...
ThinkAlex, honestly, you're surprised that someone besides yourself can write something "grammaticly" imperfect and still write software?
english |ˈiNG(g)liSH| noun spin given to a ball, esp. in pool or billiards
Happy new year, good old friend;-)!
Happy new year, too
^_^
Pretty much the same as https://www.codewars.com/kata/add-all, although there are no performance requirements in that one.
For example same as 4 By 4 Skyscrapers, 6 By 6 Skyscrapers, 7 By 7 Skyscrapers... ;-)