7 kyu
Stanton measure
2,169 of 5,545aweleshetu
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.
@aweleshetu could you stop reporting to mods messages of users saying (sometimes, even in a rather constructive way), that the description is bad?
I agree this is mostly a reading skill issue on their end, but this has nothing related with moderation.
Thx.
PS: try putting the second sentence on a new line, maybe.
@Blind4Basics thanks for your suggestion.
The description is confusing. It should more clearly explain what is being asked by the tests.
Very poor description, but the Kata is not bad
Haskell translation
Javascript:
JS should add function declaration in the initial function setup to match the other languages
fixed
slightly less confusing description update
I agree that the current description isn't great, but this is even more confusing (for me, at least). To be honest, I have no idea how to improve the description, just focus on the examples at this point.
hm alright
Confusing description (for beginners) but extremely easy once you understand on what the kata is asking for.
I don't understand anything about this kata
whaaaat, i didn't understand the question
C Translation
approved
This is broken, my tests pass but the random tests dont. This is really broken. How the heck are people solving this? Is it an english thing? Yes its the description!!!
If you want people to help, rather than just complain aimlessly:
which language are you working in?
which inputs do you think are wrong/which tests are you failing?
if you don't know answer to 2 - make sure you have read https://docs.codewars.com/training/troubleshooting/#error-messages-and-printing-your-inputoutput especially the part about printing the input
which steps have you taken trying to debug it yourself?
You have to use only number "1" for the check.
This doesnt work, Ive even looked at the random tests, they count other numbers than the number 1.
Description should be more informative, my code pass sample tests but failed on random input...
You're not doing that.
This is one of those challenges where the wording is the actual puzzle. May i suggest that "count the number of 1s in the array" become "count the number of occurences for value 1 in the array"
Done.
This comment has been hidden.
Please use a spoiler flag when you post code, and use markdown tags to format your code, otherwise it's unreadable. About this, and a general help to debug your solution, I advice you to read Codewars' documentation: https://docs.codewars.com/training/troubleshooting/
[15,1,15,1,-3,1,-8,1,-9,1,8,1,10,1,-7,1,-4,1,-5,1] '15' appears 2 times. so '2' appears 0 times. but this kata says it should be equal 1. why?! [-10,1,-1,1,7,1,10,1,-2,1,4,1,-3,1,-2,1,2,1,-7,1,11,1,4,1,-3,1,12,1,12,1,-2,1] '-10'appears 1 time. so '1' appears 16 times. but this kata says it should be equal 0 ... i think this kata is broken or author should give us much more info
Why are you counting 15s or 10s instead? All the info you need is there, read the description again. I've added a second example to make it clearer.
I can't find any definition on the internet for the Stanton Measure of an array. This doesn't appear to be a real thing. For that reason the description needs a longer and more complete explanation of what is required. This is a time waster.
The description defines clearly what is expected. Notice that more than 1800 persons solved this kata and nobody complained about that before.
I'm one of the 1,800 people that solved this Kata. But that doesn't mean the instructions couldn't use significant improvement.
What does the description not tell you about how to solve the kata?
Probably a definition created for learning purposes, but true, it does not exist anywhere on the internet being used with an array besides here.
This comment has been hidden.
COBOL translation.
Approved
This comment has been hidden.
Fork
Approved, thanks!
This comment has been hidden.
The kata description should specify what kind of
1
and2
are counted: digits or numbers. For example: does11
counts as 2 1's or 0? A sample test case with such edge cases would not hurt as well.Seems obvious we consider numbers.
Obvious does not mean explicit. These are requirements and they should be as clear as possible. Imagine someone starts couting the digits and discovers after a while that all his/her work was for nothing. ^_^.
I'm confident he'll be able to recover from it.
Added another example in the description to make it clearer.
WHAAAAAT LOL THIS?!
OKAY!!! Now I understand, the instructions are really odd for this.
I don't understand the question.
Ruby tranlsation kumited :) please review and approve ~~
I did not understand a damn thing from the description!
count the number of 1s in the array. Let this count be n. The Stanton measure is the number of times that n appears in the array.
Just try to understand this :)
in Simple english - whatever the occurnce of 1 come in array will be x and then find that occurnce of x in array
Dope kata!
R Translation kumited!
Please review and approve!
Java translation added!
Python translation kumited.
; ) )
You now have
console.log(b)
between tests. Please at least change this toconsole.log(Test.inspect(b))
, but preferably use some form ofTest.it()
withinTest.describe()
; this makes for much cleaner logging.good suggestion, i was just being kinda lazy. I know how to use those, so next kata will be clean as possible :D
Fixed, you're welcome :)