peshpatel.jnumbertools.3.0.0.source-code.Scrap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jnumbertools Show documentation
Show all versions of jnumbertools Show documentation
JNumberTools is the combinatorics and number-theory library which provides
useful APIS related to said topics
The newest version!
import io.github.deepeshpatel.jnumbertools.base.JNumberTools;
import java.util.List;
import java.util.stream.IntStream;
public class Scrap {
public static void main(String[] args) {
//Every 10^18 th lexicographical combinations of -
// any 10 distinct small alphabets and
// any 12 distinct capital alphabets and
// any 3 symbols with repetition allowed and
// all subsets in size range [10,20] of a set of numbers in [0,20)
var smallAlphabets = IntStream.rangeClosed('a', 'z').mapToObj(c -> (char) c).toList();
var capitalAlphabets = IntStream.rangeClosed('A', 'Z').mapToObj(c -> (char) c).toList();
var symbols = List.of('~','!','@','#','$','%','^','&','*','(',')');
var numbers = IntStream.rangeClosed(0, 20).boxed().toList();
JNumberTools.cartesianProduct()
.complexProductOf(10, smallAlphabets) //distinct
.andDistinct(12, capitalAlphabets) //distinct
.andMultiSelect(3, symbols) // repetition allowed
.andInRange(10, 20, numbers) // all subsets in size range
.lexOrderMth(1000_000_000_000_000_000L, 0).stream().toList();
//System.out.println(list.size());
//System.out.println(list);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy