class Solution(object): def getSum(self, n): """ :type n: int :rtype: int """ return n * (n + 1) >> 1