solution to Partition List