Skip to main content
Stripped 4 more chars
Source Link
microbian
  • 2.3k
  • 3
  • 18
  • 20

C# (112108)

int c(int n){return string.Join("",Enumerable.Range(1,n).Select(i=>i+"")).ToCharArrayToArray().Select(c=>c-'0').Sum();}

Pretty

int c(int n)
{
    return string.Join("", Enumerable.Range(1, n).Select(i => i + "")).ToCharArrayToArray().Select(c => c - '0').Sum();
}

C# (112)

int c(int n){return string.Join("",Enumerable.Range(1,n).Select(i=>i+"")).ToCharArray().Select(c=>c-'0').Sum();}

Pretty

int c(int n)
{
    return string.Join("", Enumerable.Range(1, n).Select(i => i + "")).ToCharArray().Select(c => c - '0').Sum();
}

C# (108)

int c(int n){return string.Join("",Enumerable.Range(1,n).Select(i=>i+"")).ToArray().Select(c=>c-'0').Sum();}

Pretty

int c(int n)
{
    return string.Join("", Enumerable.Range(1, n).Select(i => i + "")).ToArray().Select(c => c - '0').Sum();
}
Source Link
microbian
  • 2.3k
  • 3
  • 18
  • 20

C# (112)

int c(int n){return string.Join("",Enumerable.Range(1,n).Select(i=>i+"")).ToCharArray().Select(c=>c-'0').Sum();}

Pretty

int c(int n)
{
    return string.Join("", Enumerable.Range(1, n).Select(i => i + "")).ToCharArray().Select(c => c - '0').Sum();
}