7 kyu
Simple Fun #87: Shuffled Array
560 of 1,391myjinxin2015
Loading description...
Puzzles
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
C# tests generate warnings:
tests/Fixture.cs(107,15): warning CS0219: The variable 'passed' is assigned but its value is never used
PHP:
Ruby translation should be updated to version 3.0, see relevent information here: https://github.com/codewars/content-issues/wiki/List-of-Ruby-Kata-to-Update
C version generates warnings.
Warning have been silenced.
When I'm trying to run sample test, I get this:
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/codewarrior/run.php on line 20
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/codewarrior/run.php on line 20 me too
C translation available
Haskell : https://www.codewars.com/kumite/5be99df3fc0bc426e1000009?sel=5be99df3fc0bc426e1000009
I used list instead of array as array means something different in Haskell, and I figured the important part of this was how to find the necessary element to remove, remove it and sort vs learning how to use an array which isn't a built in type in Haskell.
Cheers ;-)
Ruby and Crystal solutions dished. Tschuss!
At the moment CW is very slow. Approved. Where is your
Python
? ;-)It was already translated by suic, regrettably Y_Y
Hi
What if a list has multiple solutions? What should we do then? Please reply.
Thanks
Can you make a concrete example? As I don't see any chance of getting two different numbers as viable solutions, but I might be short-sighted.
Well, I was wrong. There can't be two solutions.
Sum of combinations may be equal to the elements in the shuffled array but it's not necessarily the left out element. I have now completed the Kata too.
Thanks! It was really fun.
OK, thanks for your feedback ;-)
TypeScript Translation added!
Approved, thanks ;-)
Thank you!
PHP Translation added,cheers!
approved, thanks;-)
This comment has been hidden.
This comment has been hidden.
Thanks for approval. The translation follows the same pattern. Regards, suic
This comment has been hidden.
These test cases have multiple indices with different values that can be the sum of the original array.
I used this code to verify their correctness:
a is my result, b is yours sum of a is 23, my removed element is 23, right ;-) sum of b is 43, your removed element is 3, wrong? ;-)
Sorry, apparently I completely misunderstood this kata. I only failed these 2 tests, though :/
This comment has been hidden.
Goodnight ;-)
This comment has been hidden.