You are viewing a single comment's thread. Return to all comments →
public static List<Integer> permutationEquation(List<Integer> p) { Map<Integer, Integer> map = IntStream. range(0, p.size()). boxed(). collect(Collectors.toMap(s-> p.get(s), s-> s+1)); List<Integer> result = IntStream.range(1, p.size()+1). boxed(). map(map::get). map(map::get). collect(Collectors.toList()); return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sequence Equation
You are viewing a single comment's thread. Return to all comments →