不见巫山
不见巫山
全部文章
分类
归档
标签
去牛客网
登录
/
注册
不见巫山的博客
全部文章
(共31篇)
题解 | 二分查找-I
class Solution: def search(self , nums: List[int], target: int) -> int: if len(nums) == 0: return -1 s = l...
2025-04-25
0
18
题解 | 字符串变形
class Solution: def trans(self , s: str, n: int) -> str: words = s.split(' ') rev_word = words[::-1] result = [] ...
2025-04-25
0
23
题解 | 字符串变形
class Solution: def trans(self , s: str, n: int) -> str: words = s.split(' ') rev_words = words[::-1] result = [] ...
2025-04-25
0
25
题解 | 缺失的第一个正整数
class Solution: def minNumberDisappeared(self , nums: List[int]) -> int: new_nums = set(nums) n = len(nums) for i in ra...
2025-04-25
0
24
题解 | 数组中出现次数超过一半的数字
from collections import defaultdict class Solution: def MoreThanHalfNum_Solution(self, numbers: List[int]) -> int: cnt = defaultdict(i...
2025-04-25
0
25
题解 | 数组中只出现一次的两个数字
from collections import defaultdict class Solution: def FindNumsAppearOnce(self , nums: List[int]) -> List[int]: cnt = defaultdict(int...
2025-04-25
0
31
题解 | 记票统计
n = int(input()) candidate = input().split() people = int(input()) votes = input().split() cnt_votes = {} for i in candidate: cnt_votes[i] = 0 u...
2025-04-11
0
20
题解 | 走方格的方案数
import math n,m = map(int,input().split()) print(math.comb(n+m,n))
2025-04-11
0
25
题解 | 求最大连续bit数
n = int(input()) s = bin(n)[2:] max_len = mid_len = 0 for bit in s: if bit == '1': mid_len += 1 if max_len < mid_len: ...
2025-04-11
0
31
题解 | 最长回文子串
s = input().strip() n = len(s) max_len = 1 dp = [] for i in range(n): in_list = [] for j in range(n): in_list.append(False) dp.a...
2025-04-10
0
25
首页
上一页
1
2
3
4
下一页
末页