Retired
Stop Donald Trump (2015) (retired)
169sergarrick
Loading description...
Arrays
Fundamentals
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.
Simple Kata. The story is funny but not needed, but our voting system should not be 1 to 1 as it gives more power to larger states and removes all power from small states while electoral college is made so that every where has a vote.
A harder problem would be to take n number of districts in a Democratic stronghold, and draw them in such a way that Trump still wins. XD
https://www.codewars.com/kata/5a70285ab17101627a000024
Summing an array of values is not a novel kata idea.
Too much instruction for such a simple problem, can be simplified
You can't stump Trump.
Title is not that relevant. It is a good kata, but title needs to be changed to give a better idea of what the kata is about. Try to leave out political opinions.
Add random tests.
Random tests have been added to the submission tests.
The story and the actual kata are not very related. Yeah, it's nice to read about gerrymandering again, but the actual kata can be reduced to "Reduce an array of pairs to a single pair". Maybe you can improve the connection between kata and description a little bit.
I've thought a lot about this. I figure I can definately make it more difficult (more than 2 candidates for starters), but it would make it more difficult than 6 kyu. This kata originally started in my mind as more of a statement about how stupid electoral colleges and an intro to gerrymandering for those unaware of places like North Carolina, California, and Illinois. If this kata is well received over the next week or so, I'd love to explore the problem further.
Major problem: Example Java test case fail to compile.
Other than that, I'm looking forward to solving an anti-gerrymandering problem. :)
I believe I have fixed this issue now. I forgot the imports and class declaration. Thanks for helping!
This comment has been hidden.
I think it may be a code wars issue, but i can only see about 3 lines.
That's fine, the solution is only two lines : )
The tests failed on load class.
This has now been resolved. Thanks for trying my kata!
Javascript translation kumited.
more info on how to approve it ( or not )
genius :D
This comment has been hidden.
Your
results
array will have the wrong length and your are mixing up the order of the indices ofvotes
. Most likely that would cause an ArrayIndexOutOfBoundsException eventually. I haven't run the code, so maybe there is some other mistake as well.The java class is now implemented.