Solutions Giovanni: gist Calcagno: gist Pilu gist Nicola: gist Performance ranking Calcagno real 0m0.363s user 0m0.256s sys 0m0.087s Giovanni real 0m1.532s user 0m1.407s sys 0m0.109s Pilu real 0m3.320s user 0m3.026s sys 0m0.224s Nicola real 0m12.015s user 0m11.652s sys 0m0.223s Rejected implementations Elia: gist My reference implementation gist Timing real 0m0.624s user 0m0.536s sys 0m0.068s