解题思路:
1. pow
2. 二进制位运算
class Solution: def Sum_Solution(self, n): # write code here rnt = pow(n, 2) + n rnt = rnt >> 1 return rnt
解题思路:
1. pow
2. 二进制位运算
class Solution: def Sum_Solution(self, n): # write code here rnt = pow(n, 2) + n rnt = rnt >> 1 return rnt