Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

scott mankowitz

@scott mankowitz
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Are You Smarter Than A Sixth Grader (Taking Seventh Grade Math)?
    S scott mankowitz

    I think there are 16 distinct paths, as below R1U2R3R4U5R6U7 U1R2U3U4R5U6R7 R1R2U3U4R5R6U7 U1U2R3R4U5U6R7 R1R2U3R4U5U6R7 U1U2R3U4R5R6U7 U1U2R3U4R5R6U7 R1R2U3R4U5U6R7 U1U2R3R4U5U6R7 R1R2U3U4R5R6U7 U1R2U3U4R5U6R7 R1U2R3R4U5R6U7 R1U2U3U4U5R6R7 U1R2R3R4R5U6U7

    The Lounge html com help question

  • Are You Smarter Than A Sixth Grader (Taking Seventh Grade Math)?
    S scott mankowitz

    Shouldn't it be 16? If there are 8 distinct groups of 3-4 numbers that sum to 14, one path will start with the first move going up and the next will start with the first move going right. Incidentally, here is my code:

    function combine(a, min) {
    var fn = function(n, src, got, all) {
    if (n == 0) {
    if (got.length > 0) {
    all[all.length] = got;
    }
    return;
    }
    for (var j = 0; j < src.length; j++) {
    fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all);
    }
    return;
    }
    var all = [];
    for (var i = min; i < a.length; i++) {
    fn(i, a, [], all);
    }
    all.push(a);
    return all;
    }

    function arr_sum(arr) {
    var n = 0;
    for (var i = 0; i < arr.length; i++) {
    n += arr[i];
    }
    return n;
    }
    k=[1,2,3,4,5,6,7];
    combine(k, 1).filter(function(v, i) {
    return 14 == arr_sum(v)
    })

    The Lounge html com help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups