Skip to main content
deleted 1 character in body
Source Link

Swift, 3939 28 bytes

funcvar s(n:Int)->Ints={(1...n$0).reduce(0,+)}

Fairly self-explanatory.

Swift, 39 bytes

func s(n:Int)->Int{(1...n).reduce(0,+)}

Fairly self-explanatory.

Swift, 39 28 bytes

var s={(1...$0).reduce(0,+)}

Fairly self-explanatory.

Source Link

Swift, 39 bytes

func s(n:Int)->Int{(1...n).reduce(0,+)}

Fairly self-explanatory.