Ad
  • Custom User Avatar

    So the test expects false, but when you manually change it to expect true, it passes? Go figure indeed :P

    The problem is that you have two 9s in b2, but only one 3 in b1 (you need to account for multiplicity too). If you "square" b1, you get [4, 4, 9], and that's not the same as [4, 9, 9].

  • Custom User Avatar

    I have 2 failing tests

    Time: 1227ms Passed: 212Failed: 2Exit Code: 2
    

    Testing for [2, 2, 3] and [4, 9, 9]
    Log
    isSame true
    array2 element under test is 4 - sqrt is 2
    array2 element under test is 9 - sqrt is 3
    array2 element under test is 9 - sqrt is 3
    expected true to equal false

    and when i pass that into a test

        let b1 = [2, 2, 3];
        let b2 = [4, 9, 9];
        assert.isTrue(comp(b1, b2));
    
    Tests
    test
    Log
    isSame true
    array2 element under test is 4 - sqrt is 2
    array2 element under test is 9 - sqrt is 3
    array2 element under test is 9 - sqrt is 3
    Test Passed
    Completed in 1ms
    Completed in 1ms
    

    it passes - go figure :shrug

  • Custom User Avatar

    i can't even comprehend the maths in my head