思路:暴力出奇迹
class Solution:
def countQuadruplets(self, nums: List[int]) -> int:
# 暴力
n = len(nums)
count = 0
lis = []
for i in range(n):
for j in range(i,n):
for k in range(j,n):
for z in range(k,n):
if (nums[i] + nums[j] + nums[k] == nums[z]) and i<j<k<z:
count += 1
return count