Solution pass tests, use flatten with level argument