vendredi 28 juillet 2017

All sequences in range n-m of given length

Given a range, for example 5 through 10 I need a way to find all the possible combinations of numbers in that range of a given length, formula should be as efficient as possible.

A basic example:

Given range 1-3 and length 2 then (1,1)(1,2)(1,3)(2,1)(2,2)(2,3)(3,1)(3,2)(3,3).

Aucun commentaire:

Enregistrer un commentaire