6 kyu
Popping Blocks
292 of 312saudiGuy
Loading description...
Algorithms
Arrays
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.
I get the impression that solutions don't pass this use case
Seq("B", "B", "A", "A", "A", "B", "A")
. Moreover, the approved solution https://www.codewars.com/kumite/6538b31317466215f3a3ccdf?sel=6538b31317466215f3a3ccdf as well :(Just for completeness: you mean Scala tests, right?
yeah, I am talking about Scala version
pop starting from the left.
¯\(ツ)/¯It appears to me that the Scala solution is correct.
For
Seq("B", "B", "A", "A", "A", "B", "A")
I would expect:Seq("A", "A", "A", "B", "A")
Seq("B", "A")
Seq("B", "A")
when I test the reference solution
popBlocks(Seq("B", "B", "A", "A", "A", "B", "A")) => Seq("B", "A")
Do you expect something different? If so, what?
Output of my Scala refsol matches output of authors original refsol in Python. Being unable to read the description is not an issue.
Yeah, it was my blunder. I didn't notice the information about starting from the left. Pardon.
Rust translation
Approved.
CoffeeScript translation
approved.
Scala translation
approved.
My solution mutates the original input. Just wondering if that's actually acceptable?
Authors solution also does so, so I assume this is okay.
not a good practice but acceptable for this kata..
No need though.
Some of the published solutions don't pass these edge case tests:
https://www.codewars.com/kata/reviews/651bfe166ade190001d8490c/groups/652d636844133500019cd39f https://www.codewars.com/kata/reviews/651bfe166ade190001d8490c/groups/652d633c2499d8000178a0cb https://www.codewars.com/kata/reviews/651bfe166ade190001d8490c/groups/652d6219b975a80001697052
added.
currently
{"data":[{"rank":-7,"count":13},{"rank":-6,"count":5}]}
what about the suggestion bellow?
give me 2-3 examples. I will modify random tests as per your suggestion.
errr... just "strings of any size", that's all. The logic stays the same. Some empty strings, some strings of length 2 or 3 and you're good to go.
Does empty string make sense here?
done. there won't be any empty string...
It should be clarified that "types" of blocks consist of single character. Some solutions take advantage of this fact, while it's not immediately obvious from description.
we could replace single chars with "any string"? ('could make it 6kyu, I guess)
added in description.
iirc this task has been done before or as a combination of multiple tasks. I could not find an example for the former, but for the latter there are 1 and 2
(This issue is meant to prevent approval but not for the kata author to send the kata back to draft for now ^^)
I think we might have something equivalent somewhere, yes, as it's definitely a variation of some other problems (like parentheses removal, but different). But those two definitely feel like different tasks. The first has no removal repetitions (which makes most of the task). I don't really see the link with the second... => ?
I have to say it again. It's not a duplicate by the definition of the word. 95% approval...1 unsatisfied vote...
Also this clearly isn't a "blatant duplicate" per the kata authoring docs since nobody has found a published kata that does this exact task. Maybe you could argue the 'idea' of it has been done before, but if you apply that same logic, how many other kata would be invalidated on codewars?
Adjacent grouping was the key, though that one also includes string, but it uses a similar concept (except for the replacement part)
Ok, that's a 19:1 (wasn't expecting that) Also, at around end of 2020 to early 2022, kata authoring was more strict with specific PUs outright downvoting such type of tasks (Times have changed it seems ^^)
Closing this issue as per the majority votes as well as to prevent continuous downvote on this section of the comment ~~
Hi,
This is an important requirement, it shouldn't be given as a simple note.
Cheers
It's not also very clear that after each pop, the remaining items get pushed back before popping the next consecutive items.
added.
I don't understand your random tests:
given:
['D', 'B', 'C', 'D', 'D', 'D', 'C', 'B', 'C', 'D']
expected:['D', 'B', 'C', 'B', 'C', 'D']
Why? The first block of 3
D
s is eliminated. Then we haveC
touching, so they're gone. Then we have a group ofB
touching. Shouldn't the final result be['D', 'C', 'D']
?Are you sure? The reference solution return
['D', 'C', 'D']
.The author must have updated it. I refreshed and was able to submit.
.