class Solution:
def twoSum(self, numbers: List[int], target: int) -> List[int]:
# 数组长度
n = len(numbers)
# 定义双指针
head = 0
tail = n - 1
# 开始双指针操作
while head < tail:
if numbers[head] + numbers[tail] < target:
head += 1
elif numbers[head] + numbers[tail] > target:
tail -= 1
else:
return [head+1, tail+1]
return []
# Write your MySQL query statement below
SELECT
MAX(num) AS 'num'
FROM
(SELECT
num
FROM
MyNumbers
GROUP BY
num
HAVING
COUNT(num) = 1) AS A
import pandas as pd
def biggest_single_number(my_numbers: pd.DataFrame) -> pd.DataFrame:
data = my_numbers.groupby(['num'], as_index=False).size()
data = data[data['size']==1]
max_num = data['num'].max()
return pd.DataFrame([[max_num]], columns=['num'])
(词卡方向写反了,重新贴一遍哈哈哈哈)
(书包太大了,参赛包装不下,只能把号码写书包上了。。。。)