Ad
  • Custom User Avatar

    Hey, for those using TypeScript, you will need to fix the specs for the sample test to make reference a self closing tag like below

    /// <reference path="/runner/typings/mocha/index.d.ts" />
    /// <reference path="/runner/typings/chai/index.d.ts" />
    
  • Custom User Avatar

    Thanks, is it ok that I have both in there. I made minor changes to the javascript program since things like station were not needed.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Can I humbly request you change the name of the function from push to unshift or prepend? Although it is completely my fault, I did not thoroughly read the instructions, and definitely wrote it as a push method.

  • Custom User Avatar

    Awesome kata. I would like to mention that when I left a 'byebug' line in the code, the system said I completed the kata. You may want to look into why the behavior occurred

  • Custom User Avatar

    Really challenging problem. I can't say if it is a 3 kyu or not, but definitely took me a bit to get it right. It would be interesting if you made a separate one that dealt more with efficiency. The top solution in ruby is elegant and really well thought out, but it can't handle moderately large numbers (anything in the 10 million+).

    Regardless, great problem

  • Custom User Avatar

    This was really challenging, but a lot of fun. It was refreshing to having a kata that was simple to understand and difficult to execute efficiently and cleanly.

    For people testing at home, I quickly wrote this to help create a randomize set of cards for testing.

      class Card
        attr_reader :count, :color, :shape, :filling
      
        def initialize(count, color, shape, filling)
          @count = count
          @color = color
          @shape = shape
          @filling = filling
        end
      end
      
      def create_cards
        cards = []
        [1,2,3].each do |cnt|
          ["red","green","blue"].each do |color|
            ["rect", "oval", "odd"].each do |shape|
              ["plain", "shade", "full"].each do |filling|
                cards << Card.new(cnt, color, shape,filling)
              end
            end
          end
        end
      
        return cards
      end
      
      def create_play_set
        cards = create_cards
        play_set = Array.new(4) { Array.new(3) }
      
        return play_set.map do |row|
          row.map do |value|
            cards.delete(cards.sample)
          end
        end
      end
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This was a great kata, but I would argue that it is closer to a 7/6 kyu difficulty level.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This is a great problem! I had a simple solution to it (and it made it through ~350 tests before timing out), but it forced me to really think through an optimized way of handling large start points, and still allowed for a (somewhat) elegant solution.

  • Custom User Avatar

    This was a slog, and I don't feel like it was the best learning opportunity, especially when reviewing your solution. There were a lot of things that users can learn from a similar problem, such as memoization, or even algorithms relating to GCD (I didn't know there was a gcd function, so at least I learned something about the Euclidean method), but the problem was set up without those in mind. I also was not crazy about the fact that a 5kyu problem does not have an elegant solution. Hopefully you don't find this insulting, however (IMHO) the best Kata's are those that teach you something about algorithms, math concepts, or elegant writing, and this kata comes close in some regards, but just isn't there yet.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Here are test cases for the ruby people, so they can understand indexing and what the output should be

     it "should create proper triangles" do 
        Test.assert_equals(pascalsTriangle(1), [1])
        Test.assert_equals(pascalsTriangle(4), [1,1,1,1,2,1,1,3,3,1])
      end
    
  • Custom User Avatar

    This does not work in ruby (as you have it) because of the following

    class Sudoku() #remove ()

    def is_valid(self) #remove (self)

    This is why some people are getting the \n error