nv-facutil-slow-size-combo
v1.0.2
Published
nv-facutil-slow-size-combo ======================= - split a number to several numbers: MATCH number === sum(...numbers) - its SLOW. used in cli code-generator
Downloads
5
Readme
nv-facutil-slow-size-combo
- split a number to several numbers: MATCH number === sum(...numbers)
- its SLOW. used in cli code-generator
install
- npm install nv-facutil-slow-size-combo
usage
const { _gen, to_ary} = require("nv-facutil-slow-size-combo");
example
> to_ary(1)
[ [ 1 ] ]
> to_ary(2)
[ [ 2 ], [ 1, 1 ] ]
> to_ary(3)
[ [ 3 ], [ 2, 1 ], [ 1, 2 ], [ 1, 1, 1 ] ]
> to_ary(4)
[
[ 4 ],
[ 3, 1 ],
[ 2, 2 ],
[ 2, 1, 1 ],
[ 1, 3 ],
[ 1, 2, 1 ],
[ 1, 1, 2 ],
[ 1, 1, 1, 1 ]
]
> to_ary(5)
[
[ 5 ], [ 4, 1 ],
[ 3, 2 ], [ 3, 1, 1 ],
[ 2, 3 ], [ 2, 2, 1 ],
[ 2, 1, 2 ], [ 2, 1, 1, 1 ],
[ 1, 4 ], [ 1, 3, 1 ],
[ 1, 2, 2 ], [ 1, 2, 1, 1 ],
[ 1, 1, 3 ], [ 1, 1, 2, 1 ],
[ 1, 1, 1, 2 ], [ 1, 1, 1, 1, 1 ]
]
> to_ary(6)
[
[ 6 ], [ 5, 1 ],
[ 4, 2 ], [ 4, 1, 1 ],
[ 3, 3 ], [ 3, 2, 1 ],
[ 3, 1, 2 ], [ 3, 1, 1, 1 ],
[ 2, 4 ], [ 2, 3, 1 ],
[ 2, 2, 2 ], [ 2, 2, 1, 1 ],
[ 2, 1, 3 ], [ 2, 1, 2, 1 ],
[ 2, 1, 1, 2 ], [ 2, 1, 1, 1, 1 ],
[ 1, 5 ], [ 1, 4, 1 ],
[ 1, 3, 2 ], [ 1, 3, 1, 1 ],
[ 1, 2, 3 ], [ 1, 2, 2, 1 ],
[ 1, 2, 1, 2 ], [ 1, 2, 1, 1, 1 ],
[ 1, 1, 4 ], [ 1, 1, 3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