Leno_B
Leno_B
全部文章
分类
题解(6)
归档
标签
去牛客网
登录
/
注册
Leno_B的博客
全部文章
(共6篇)
题解 | #孩子们的游戏(圆圈中最后剩下的数)#
class Solution: def LastRemaining_Solution(self , n: int, m: int) -> int: # 烫手山芋, 队列实现删除元素 res_quene = list(range(0, n)) ...
Python3
队列
2022-03-10
6
336
题解 | #和为S的连续正数序列#
class Solution: def LeftRotateString(self , str: str, n: int) -> str: # 用一个指针记录,然后最后向右读取和向左读取字符串 if not str: ...
Python3
字符串
2022-03-10
3
320
题解 | #和为S的连续正数序列#
class Solution: def FindContinuousSequence(self , sum: int) -> List[List[int]]: # 左右指针求取区间的值 left = 1 right = 2 res =...
Python3
双指针
2022-03-10
0
303
题解 | #把数组排成最小的数#
class Solution: def PrintMinNumber(self , numbers: List[int]) -> str: if not numbers: return "" # 判断 a+b v...
Python3
字符串
数组
2022-03-09
0
328
题解 | #表示数值的字符串#
class Solution: def isNumeric(self , str: str) -> bool: # 根据准则来判断 count_point = 0 # 小数点flag count_e = 0 # e的f...
Python3
字符串
2022-03-08
2
349
题解 | #数值的整数次方#
非递归的快速幂/位运算 class Solution: def Power(self , base: float, exponent: int) -> float: if exponent<0: # 如果幂小于0 exponent = ...
Python3
数学
2022-03-04
0
321