Ad
  • Custom User Avatar

    Yeah, this kata doesn't need random input tests, because it doesnt need inputs at all.

    While the basis is somewhat interesting, I don't think it really makes a good kata. Especially as that currently, return any wrong answer and the tests will tell you what the correct result is...

    Btw, feel free to visit the discord, we have a channel specifically for helping authors. You can get advice/opinions and help there for the next kata you make :)

  • Custom User Avatar

    if you can't think of any input parameter, perhaps you shouldn't have any ;)

  • Custom User Avatar

    What would you suggest is a more meaningful input parameter?

  • Custom User Avatar

    This is my first kata submission but thanks for the input. There are no random tests as there is exactly 1 number that meets the requirement in nums 1-infinity.

  • Default User Avatar

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

  • Custom User Avatar

    What's the purpose of the input parameter? Seems useless

  • Custom User Avatar

    Can someone please explain to me why this code is passing all 5 of the basic test cases but then fails upon 'Attempt':

    def add_binary(a,b):
    empty_list = []
    new_num = a + b
    while new_num > 1:
    if new_num % 2 == 0:
    empty_list.append('0')
    new_num = new_num / 2
    continue
    elif new_num % 2 == 1:
    empty_list.append('1')
    new_num = new_num // 2
    continue
    else:
    empty_list.append('1')
    answer = "".join(empty_list[::-1])
    return answer