5 kyu

Containers

67 of 254sazzadshopno
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • senior_kapitoshka Avatar

    it took a while to understand the task, although the solution itself is not at all complicated. very good kata

  • dfhwze Avatar

    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.

  • vpopolitov Avatar

    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!

  • mauro-1 Avatar
  • mauro-1 Avatar

    This comment has been hidden.

  • Nima155 Avatar

    This comment has been hidden.

  • KenKamau Avatar

    I'm having a difficult time understanding the requirements.

    Containers("A") = return 1; I don't undestand why we need to stack here if there is only one container to be loaded to ship A
    
    The Kata says "... When all containers have arrived, the ships are loaded in strictly increasing order: first ship A, then ship B,.."
    Containers("CCCCBBBBAAAA") = return 1; Does the arrival order matter? In this case, are the Cs on top of the Bs which are on top of the As? If so, I expect the stack required to be 2 not 1 because you stack the C then the B (2 stacks) and then you begin loading A. 
    If the 'A's are on top of the Cs, then I expect stacks to be 0 not 1.
    
    Please give more information on how the specific example you have given are answered. 
    
  • kylelowa88 Avatar

    a 5kyu kata shouldn't take people so long to even understand what you're trying to ask here.

  • RALifeCoach Avatar

    I am getting smaller numbers with correct solutions. For example, "ACTWOFMFHPHNDBSEWLNCAOBROMTKCIBADB" gives me 7 stacks instead of the expected 9 stacks.

  • Colossus Avatar

    DarkD1 This has to be my favourite kata so far. A real world problem requiring a solution.

  • aydang Avatar

    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?

  • eswar.183 Avatar

    I tried to understand the problem for 20 mins, still can't say I get it. I must be stupid.

  • jgam Avatar

    poorly worded. Please explain regarding sample inputs and outputs. Not just random inputs!