Skip to content

Instantly share code, notes, and snippets.

View michalcholewinski's full-sized avatar

Michał Cholewiński michalcholewinski

View GitHub Profile
public Integer[] myFlatten(Object[] input) throws IllegalArgumentException {
if (input == null) return null;
List<Integer> result = new ArrayList<Integer>();
for (Object e : input) {
if (e instanceof Integer) {
result.add((Integer) e);
} else if (e instanceof Object[]) {