• Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    The largest palindrome comes from 15*125 = 1875 -> 8.

  • Custom User Avatar

    There is a smarter way to do this than using recursion :)

  • Custom User Avatar

    Is there a smaller pyramid that has the same longest slide.
    Take a look at the small pyramid and think about it.

  • Custom User Avatar

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

  • Custom User Avatar

    Is it me or is it a bug?

    [ 15, 125, 8 ]
    product = 15000
    pairs = { '0': 1 }
    singles = ['0', '1', '5' ]
    highest single = 5
    result = 050
    = 5

    ✘ Expected: 8, instead got: 5

  • Custom User Avatar

    Everything worked except for the last test, 300.11. The error it got was '✘ Expected: -300.10, instead got: -300.11' It's suppose to be 300.11, right? That's what my code returns, and it's wrong

    My code is:

    var numberToPrice = function(num) {
    var sign = '';
    num = ((Math.floor(num*100))/100).toFixed(2).toString()
    if (num.slice(0,1) =='-') {
    sign = num.split('').shift()
    num = num.split('')
    num.shift()
    num = num.join('')
    }
    if (num.indexOf('.')>3) {
    num = num.replace(/(\d{3}.)/g,',$1');
    for (var i=0; i<(num.indexOf(',')); i++) {
    num = num.replace(/(\d)(\d{3},)/g,'$1,$2')
    }
    }
    return sign + num
    }

    Thanks for reading

  • Custom User Avatar

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

  • Custom User Avatar

    Or, if you're using javascript (which I guess based on your previous katas), you can just use console.log:

      function isMerge(s, part1, part2) {
        console.log('Params:', s, ':', part1, ':', part2);
        // ...your solution
      }
    

    I added the colons between the parameters so it will be easier to see when one of them is an empty string.

  • Custom User Avatar

    For example:

    def is_merged(s, part1, part2):
        print(s, part1, part2)
        # ... your solution
    

    But better use repr() because you will have to deal with empty strings.

  • Custom User Avatar

    Can someone please tell me how to "add print line" in my code to get the input? I can't debug my code until I figure out which tests my code failed!

  • Custom User Avatar

    Oh makes sense.

  • Custom User Avatar

    This is not an issue with the kata because there are no default test cases.
    please resolve,

    Thank you :)

  • Custom User Avatar

    My solution failed the test but passed when I clicked submit.

  • Loading more items...