class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
需要关注输出的数据格式为list
对于def而言,需要有return作为输出,而非print
否则例题输出为null
而想要将列表作为输出,直接return[i,j]即可