江泽政
江泽政
全部文章
分类
题解(5)
归档
标签
去牛客网
登录
/
注册
江泽政的博客
全部文章
(共5篇)
题解 | #从单向链表中删除指定值的节点#
# 数据结构 class ListNode: def __init__(self, data=None, next=None): self.data = data self.next = next # 找到某个节点 def findVal(h...
Python3
2021-11-15
5
572
题解 | #求最小公倍数#
最大公因数和最小公倍数乘积为:ab,用a*b/最大公约数即可* def gys(a, b): while (b != 0): c=a%b a=b b=c return a s = input() sList = s.split() a...
Python3
2021-11-11
0
295
题解 | #字符逆序#
巧用reversed() while True: try: s = input() revS = list(reversed(s)) answer = "".join(revS) print(answer) except...
Python3
字符串
2021-11-11
0
365
题解 | #密码强度等级#
Python3 解法,巧用ASCII while True: try: s = input() sc = 0 # 密码长度 if len(s) <= 4: sc += 5 elif...
Python3
2021-11-11
0
386
题解 | #求最大连续bit数#
Python3 解题思路 try: s = input() ## 数字格式-> 二元格式 -> 清除非数字 -> 零作为间隔符号 string = bin(int(s)).replace("0b", "").split("0"...
Python3
字符串
2021-11-11
29
985