public static int[] deepFlatten(Object[] input) { return Arrays.stream(input) .flatMapToInt(o -> { if (o instanceof Object[]) { return Arrays.stream(deepFlatten((Object[]) o)); } return IntStream.of((Integer) o); }).toArray(); }
public static int[] deepFlatten(Object[] input) { return Arrays.stream(input) .flatMapToInt(o -> { if (o instanceof Object[]) { return Arrays.stream(deepFlatten((Object[]) o)); } return IntStream.of((Integer) o); }).toArray(); }