Skip to content

Instantly share code, notes, and snippets.

View lwld's full-sized avatar

Luzian Wild lwld

View GitHub Profile
@lwld
lwld / ListPermutation.java
Last active February 22, 2016 11:15
Permutations of a certain length of a list (combinations, choose k of n, unordered) (v2)
import com.google.common.collect.Lists;
import java.util.List;
public class ListPermutation {
public static void main(String[] args) {
for (int i = 0; i <= 6; i++) {
System.out.println("Take " + i + " of 5: " + permutations(Lists.newArrayList(1, 2, 3, 4, 5), i));
}
@lwld
lwld / ListPermutation.java
Last active January 24, 2019 03:17
Permutations of a certain length of a list (combinations, choose k of n, unordered)
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class ListPermutation {
public static void main(String[] args) {
for (int i = 0; i < 6; i++) {