Skip to main content
3 of 3
Commonmark migration

C# 6, 125+31 125+18 = 143 bytes

string f(int[] n,string s="")=>s+string.Join(" ",n)+"\n"+(n.Length>1?f(n.Zip(n.Skip(1),(a,b)=>(a+b)%10).ToArray(),s+" "):"");

The +18 is for using System.Linq;

Thanks to @TheLethalCoder for saving 13 bytes, by pointing out a unnecessary using statement

Sok
  • 6.2k
  • 1
  • 17
  • 30