yes Kevin, I had posted to another forum, as I tried to solve it and i am stuck, i am still learning perl and i was stuck upto splitting the array, not knowing how to assign values to that. I know the algorithm, but i find it very difficult to write the syntax.