pad array solution