7 kyu
Coloured Triangles
4,922 of 11,211Avanta
Loading description...
Logic
Strings
Algorithms
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 required.
More details here and here
updated by OP
Done in c++. Thanks for Kata. It can be 6 rang. The point are the last characters of the string.
Thank you for kata! I've enjoyed it. Tricky from the first glance, but doable eventually.
Not that hard actually, very nice kyu.
Update to Scala 3
Thanks, approved.
D translation
Thanks, approved.
Go translation
Thanks, approved.
It's not 7kyu, mb 6 || 5. But intresting =)
Thanks for the Kata !
Thanks for enjoying it :)
It's not 7 kyu
Excelent kata, even though it is a bit hard for a seven. Good thing I've been prepared.
Great Kata! Thank you!
Glad you enjoyed it :)
This is hard for a 7kyu kata imo...
The problem was poorly specified IMHO
:(
Can't seem to work this one out. I pass 50 but fail 70. Can't figure out why it would work for some and not for others. Any hints??
You could post your code with the spoiler tag
This comment has been hidden.
This comment has been hidden.
Reply to my comment to see the spoiler
Thanks
Oh wow. I cant believe how much time I spent on such a simple error. Haha
Thanks for the help. Appreciate it. 👍
No problem :)
.
This comment has been hidden.
This comment has been hidden.
how do you know that 30 chars is enough to hold the input string ? you have no guarantee on that
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
Ruby 3.0 enabled
Thanks very much
Truly enjoyed this kata. But I felt it is worth 5kyu or at least 6kyu.
Guys, great kata! But I really do think that is way too much for 7 kyu.
Thanks for enjoying the kata :)
I agree about the rank, but unfortunately, I don't think it can be changed anymore.
exactly!
I'm passing the given tests but failing some of the random ones. I'm struggling to come up with tests that will cover some of the edge cases. Could anyone give me a test or two that covers some tricky edge cases?
Print them.
I'm getting the correct values, but after the first success it's returning everything as undefined. I.e. I'm getting B as my last result, and it's saying B is the correct answer but it's saying it's undefined. Am I missing something?
I've forked the Rust translation in order to update it to Rust 1.49 and updated
rand::Rng::gen_range
to its new signature that takes astd::ops::Range
.Approved, thanks
Sounds like a 7kyu. Feels like a 4kyu.
(Python) My code passed the "all" tests, but not the test #5 in the simple tests. How is it possible ?? It seems to me that this case has nothing special...
I honestly think there is something a miss with the test cases. At least in python
I really enjoyed this one. I was a bit surprised it was a 7 after the last bunch of 7's I did. maybe could be a 6?
ranks cant be changed thoo~~
I tested my code on VS Code and it has correct results but it does not work here in Codewars. May I know why?
There's a couple of possible reasons: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#my-machine
Thanks! I guess I have to rethink of other ways on how to solve this Kata.
Because Microsoft loves us
This comment has been hidden.
This comment has been hidden.
yes sorry, that's what i meant. But is that right?? My function does return none , why is that. Shouldn't it be running the function multiple times??
This comment has been hidden.
I already wrote the entire triangle with spaces, etc. before I realized that only the vertex of the triangle is required to complete the task :)
Shouldn't this be a 5kyu or 6kyu Kata?
Can't be changed.
It will be nothing wrong is smbd adopt kata to PHP(!)
Rust translation kumited. Please check and approve if you like.
Haskell Translation prepared. Please check and approve if possible.
This comment has been hidden.
It would help if you used markup with 3 back tics (the quote symbol near the "1" key) before and after your code. That preserves indentation.
Only the first line of the stack trace is useful, it would be better to remove the rest.
Finally, it helps to know the input: what string of characters does your code fail on?
Ruby translation kumited -- please check and approve!
Approved thanks
This comment has been hidden.
Your function should return, not print, and mark your post as having spoiler content next time.
This comment has been hidden.
Nice kata :)
This comment has been hidden.
I changed the order of the test cases. As for your second point, I don't think it matters too much because of the random tests.
one of the tests is: assertEquals('B', Kata.triangle("RGBG"));
given that input string, shouldn't the test be: assertEquals('G', Kata.triangle("RGBG"));
No, look at this example:
right. I was looking at discrete pairs (don't ask what I did with odd numbered strings) so, in my interpretation, it should have been: RGBG BR G
my mistake. thank you.
Julia translation kumited
Approved
I have written the Java code which passes sample test but fails submission with something like expected:82 but was :66 i have tested the code manually outside of Kata and also works fine can someone check what is wrong with my code? I will try to add code as spoiler below.
This comment has been hidden.
This comment has been hidden.
On Python i get:
Although I can run it just fine in my own computer.
Don't name any functions
test
orTest
as Codewars uses that as the testing module.On Java mistake.
countB - 5 countR - 11 countG - 15
expected: 82 but was:66
What do you mean?
Task# if colors are different, the missing colour is used in new row So we should output color which we use less all? 66 it Unicode of B.
I just completed it in Java: it works fine.
You shouldn't output any unicode. Did you even read the description? :P
EDIT: Ignore that, I didn't realise Java showed the Ascii value of a char instead of the actual character. Even so, you may be misunderstanding the task. Try to re-read the description or post your code as a spoiler for help.
Oh my GOD I fool. I forget to delete System.out.println from test Sorry me
Coffeescript translation
Approved thanks
The harder version has got a good amount of solves, so may I ask you to approve it?
Also, glad to see that you linked my kata in the description, thanks!
I'm not really sure what rank to put it at though. I voted 4kyu, but the average is 2kyu so I'll probably just go with that.
I also initially ranked 4kyu, but it seems challenging for the majority. (I saw a top warrior trying hard to figure it out for a whole day, and he's still yet to solve it...)
Anyway, thanks a lot! :)
Translated to Java - https://www.codewars.com/kumite/5a2b937ff28b825df1000053?sel=5a2b937ff28b825df1000053
Pending your approval
Approved. Thanks :)