Array solution