Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Nice kata.
'A'.repeat(200)
markdowns formatting are broken in the description
I don't understand if the function should return that there is at least one rainbow in the case where the elements are there but not in order.
For example, is there 'RED' in 'DER'?
All the way across the sky!
...whoa
What does this mean? It's so bright, so vivid
I've just republished this kata with improvements: https://www.codewars.com/kata/double-rainbow
Thanks for your help with the (very fundamental) issues last time!
I've just republished this kata with improvements: https://www.codewars.com/kata/double-rainbow
Thanks for your help with the (very fundamental) issues last time!
I have just republished this kata (with improvements) here: https://www.codewars.com/kata/double-rainbow
Hopefully should be much less basic problems this time around!
Thanks for the explanation!
I haven't encountered constants yet, but will certainly look into them.
I'm under no illusions that my solution will by any means be the most efficient/concise/elegant - am very much expecting others to submit far shorter, better solutions at this point!
Apreciate the explanations.
You were reinventing a lot of wheels. One of them was that
Object
with sequential numerical keys. You could just have definedconst LETTERS=" ABDEGILNORTUVWY"
( constants should have names in ALL_CAPS ), and it would have behaved exactly likeletterObj
( apart from the element at index0
. but you could have made that work, somehow, probably ).LETTERS[1]
would have been"A"
, etc etc.People do it all the time, and I catch myself doing it sometimes: defining an
Array
["a","b","c"]
instead of simply aString
"abc"
. You only went a step further even, defining anObject
that could have been simply aString
, with all the appropriate properties.That's all it was really. It works, but it could have been done more simply.
Sorry to get back to you on this so late, but would you mind explaining what you mean by this comment below? (I can't seem to be able to reply directly to that comment, so I'm quoting it here):
"Also, this
var letterObj = {1:'A', 2:'B', 3:'D', 4:'E', 5:'G', 6:'I', 7:'L', 8:'N', 9:'O', 10:'R', 11:'T', 12:'U', 13:'V', 14:'W', 15:'Y'};
is what strings (and arrays) are for, and please indent your solution properly. It's unreadable."
I understand what strings and arrays are, of course, but not what you mean by your suggestion. I also understand that the indentation is not ideal, and am fixing that.
Thank you.
Thanks, I may do that!
You're always welcome to fix this kata and then make a brand new kata with it ;-)
The point of random tests is not that the input is random, it is that the expected output is random. The usual way to achieve this is generating random input, processing it through a reference solution and comparing that output to the user output for the same input. Alternatively, you generate a random output, generate a matching input, and compare the output to the user output for that input. ( Sometimes, there are still other ways to randomly test. )
5
true
5false
is too predictable; I don't have to look at the input at all, just count inputs.Test.randomize
does not fully automate random testing, but it will shuffle an array ( and, by extension, a string ); you don't have to write code to do this yourself.It's too late for this kata I suppose, it being retired ( I don't really know what that means, but it isn't showing up any more in places it used to ), but you get a second shot at a first kata.
Loading more items...