add solution to optional array problem