02 2024 档案
摘要:C语言 #sscanf #代码学习 #codewars 题目链接:IP Validation | Codewars 代码如下: #include <stdio.h> int is_valid_ip(const char *addr) { unsigned n[4], i, nc; // Must b
阅读全文
摘要:题目链接:https://www.codewars.com/kata/5426d7a2c2c7784365000783/python def balanced_parens(n): ''' To construct all the possible strings with n pairs of b
阅读全文
摘要:题目链接:https://www.codewars.com/kata/5426d7a2c2c7784365000783/python 我的解决方案: def balanced_parens(n): # Your code here! used_l=[False for i in range(n)]
阅读全文
摘要:题目的要求是写一个Sudoku类,类中要有一个实例函数判断传给对象的二维数组是否符合数独规则 题目链接:https://www.codewars.com/kata/540afbe2dc9f615d5e000425/python 下面是写完题后看到的别人的解决方法 from itertools imp
阅读全文
摘要:做题的时候有的测试点里竟然用True替换1,骗过了我的代码,结果没过测试点 lst = [1, True] for item in lst: if not isinstance(item, bool) and item == 1: print(item)
阅读全文