sumFromOne

fun sumFromOne(n: Int): Int

This function uses a trick by a famous mathematician, Fredrick Gauss. Algorithm is O(1).

Return

Int

Parameters

n

Int