def arrayPairSum(self, nums):
return sum(nums[i] for i in range(len(nums)) if i % 2 == 0)
The second line can be
@nkukarl You're right.
My Latest one-line submission:
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.