sort alternatively and smallest positive not equal to sum of any subset