Ad
  • Default User Avatar

    It's works!

    I have

    Array.prototype.sum = function() {
     for (var i = 0, sum = 0; i < this.length; sum += parseInt(this[i++]));
     return sum;
    };
    

    Function "sum" is guilty. Why? I do not know.

  • Default User Avatar
    Testing Order Weights: 471333 127 189301 184 195296 185 305839 199 409179 101 288517 87 113430 182 265352 166 292037 129 454429 92 32
    

    My function input (console.log()):

    471333 127 189301 184 195296 185 305839 199 409179 101 288517 87 113430 182 265352 166 292037 129 454429 92 32
    

    My function output (console.log()):

    101 32 127 182 92 113430 129 166 184 185 87 199 471333 189301 265352 292037 305839 454429 409179 288517 195296
    

    Console output:

    It should work for random tests too - Expected: 471333 32 189301 184 195296 185 305839 199 409179 101 127 87 113430 182 265352 166 292037 129 454429 92 288517, instead got: 101 32 127 182 92 113430 129 166 184 185 87 199 471333 189301 265352 292037 305839 454429 409179 288517 195296
    
  • Default User Avatar

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

  • Default User Avatar

    In Javascript again:

    Testing Order Weights: 3586 17 135122 66 105243 168 142653 64 407988 34 388602 127 108585 99 100626 12 291904 180 340923 176 2

    It should work for random tests too - Expected: 3586 2 135122 66 105243 168 142653 64 407988 34 17 127 108585 99 100626 12 291904 180 340923 176 388602, instead got: 2 12 34 17 180 127 64 66 135122 176 100626 105243 168 99 142653 340923 3586 291904 108585 388602 407988

    And others "Random tests".