5 kyu
Containers
67 of 254sazzadshopno
Loading description...
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.
it took a while to understand the task, although the solution itself is not at all complicated. very good kata
How does
CODEWARS
need 5 stacks? The way I see it, any shipment, no matter how complex only needs 3 stacks at most, 2 stacks to toggle and 1 to add the containers in correct order. The description fails to describe the mechanics.I don't agree with the commenters below. Usually I spend a lot of time trying to reveal the purpose of a task - but this wasn't the case here. The description and examples (especially the one with "CODEWARS" string) are good written and make the task pretty easy to grasp. Nice kata and good job, @DarkD1!
I couldn't agree less. We don't know if we are allowed to switch containers that we already put on a stack earlier on. Specs are of low quality.
Python translation:
https://www.codewars.com/kumite/5fd543766efa9f00188ef0bc?sel=5fd543766efa9f00188ef0bc
I'd like to approve but I can't make anything from the current description of the kata.
This comment has been hidden.
Fixed
This comment has been hidden.
This comment has been hidden.
.
Having enjoyed this Kata I've submitted a C# Translation. https://www.codewars.com/kumite/5d284a5f30ccfb001840a95f?sel=5d284a5f30ccfb001840a95f
approved
I'm having a difficult time understanding the requirements.
I figured it out, but it may be helpful to add the detail.
In case it helps others, because "help, I have problem X! Nvm I figured it out" doesn't help someone with the same problem:
Container A needs to be stacked because it needs to be taken off the railcar and put somewhere before the ship arrives. All the containers arrive before the first ship turns up.
It is critical, and the string defines the order.
No, the Bs end up on top of the Cs or next to them, depending on your stacking choices. In "CCCBBB", 3 Cs arrive first, then 3 Bs arrive. Your crane removes a C from the railcar and puts it somewhere, then it removes another C, then another, then it removes a B. That B could go on top of a C, because ship B will turn up before ship C, meaning the crate B can be lifted and placed on ship B before there is any demand for any crate C
a 5kyu kata shouldn't take people so long to even understand what you're trying to ask here.
+1
I am getting smaller numbers with correct solutions. For example, "ACTWOFMFHPHNDBSEWLNCAOBROMTKCIBADB" gives me 7 stacks instead of the expected 9 stacks.
DarkD1 This has to be my favourite kata so far. A real world problem requiring a solution.
Hi. I believe I have a solution. It passes the test cases but always times out at the end. I have tested it on random strings between 1-500 capital letters and it consistently finishes in less than a second. DarkD1 help me out man! Any hint as to what the problem could be?
There are
500
random test cases so you need to optimize your algorithm to pass all cases within time.This isn't a kata issue.
I tried to understand the problem for 20 mins, still can't say I get it. I must be stupid.
This comment has been hidden.
poorly worded. Please explain regarding sample inputs and outputs. Not just random inputs!
What?