Ad
  • Custom User Avatar

    i understand this is testing for an empty argument but my code 'if words.empty?' still seems to raise the same errors: 'get_count': wrong number of arguments (0 for 1) (ArgumentError) from'
    am i missing something?

  • Custom User Avatar

    Also, I'm going to assume after looking at your profile that you need it in Ruby. :P Here ya go!

    def testing(actual, expected)
        Test.assert_equals(actual, expected)
    end
    
    Test.describe("wallpaper") do
        Test.it("Basic tests") do   
            testing(get_count(123),2)
            testing(get_count(1230),5)
            testing(get_count(1),0)
            testing(get_count(1111111111),25)
        end
    end
    
  • Custom User Avatar

    What language do you need the tests in? Also, it is true that (1111111111) results in 25. Your 10^2 thinking is clever, but it is incorrect. For example:

    1111111111/1 is divisible,
    1111111111/11 is divisible,
    BUT when you begin testing the 111's, you will realize that 1111111111/111 does not go in evenly. Same with the 1111's.

    So your 10^2 would be correct if you were looking for all consecutive combinations and not worrying about if they're divisible, but it is incorrect because we DO care about divisibility.

  • Custom User Avatar

    hi i seem to have lost all the tests written for this, would it be possible to supply them again? in addition to this, very confused with the last test. as i seem to recall, (1111111111) resulted to 25. surely this is more, as all the 1's combine together to produce 10^2 combinations? please explain!