牛客393424022号
牛客393424022号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客393424022号的博客
全部文章
/ 题解
(共5篇)
题解 | #字符串加解密#
常规做法 def encrypt(text: str): li = [] for char in text: # 字母 if char.isalpha(): if char == 'z': li....
Python3
2022-06-23
0
186
题解 | #查找兄弟单词#
陷入列表不能自拔^_^ tmp = input().split() # 依次获取单词个数、单词、要查找的单词及字典排列的第k个单词 n = int(tmp[0]) words = tmp[1:-2] x = tmp[-2] k = int(tmp[-1]) xval = [ord(i) for i...
Python3
2022-06-21
0
135
题解 | #删除字符串中出现次数最少的字符#
tmp = input() chars = set(tmp) dic = {char: tmp.count(char) for char in chars} minval = min(dic.values()) for char in dic: if dic[char] == minval:...
Python3
2022-06-20
1
132
题解 | #密码验证合格程序#
def check_passwd(passwd: str) -> bool: # 1. 校验密码长度 if len(passwd) <= 8: return False # 2. 校验字符 num = [0] * 4 fo...
Python3
2022-06-19
4
285
题解 | #坐标移动#
li = input().split(';') x = 0 y = 0 for item in li: if item: try: flag, num = item[:1], int(item[1:]) except: ...
Python3
2022-06-19
0
210