search

Home  >  Q&A  >  body text

javascript - Algorithm question: Take n elements from an array to generate a new array. How many can be generated?

For example, if you take the array [1,2,3] and take 2 elements to generate an array, there will be three situations: [1,2], [1,3], and [2,3] (the same number inside will be counted as one) (for example, [1,2] and [2,1] are considered the same), please implement it, preferably js? Please give me more advice!

某草草某草草2777 days ago556

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-18 10:57:51

    Questions about permutations and combinations in high school http://www.cnblogs.com/kaiye/...

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-18 10:57:51

    High school mathematics, isn’t this just a permutation and combination

    reply
    0
  • Cancelreply