Skip to content

Instantly share code, notes, and snippets.

View rnnds's full-sized avatar
🏠
Working from home

Ronan rnnds

🏠
Working from home
View GitHub Profile
@rnnds
rnnds / IntegerFlattener.java
Created December 7, 2018 12:20
Array of arbitrarily nested arrays of integers into a flat array of integers
import static java.util.Arrays.asList;
import static org.springframework.util.Assert.notNull;
import java.util.ArrayList;
import java.util.List;
public class IntegerFlattener {
public Integer[] flatten(final Object[] source) {
notNull(source, "Invalid input: " + source);