- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 codewar_Ones and Zeros(二进制与十进制转换)
要求: 将给定的二进制转换为十进制Input: data = [0, 0, 1, 1]Output: 3Clever:代码片段1def binary_array_to_number(arr): return int("".join(map(str,arr)),2) # map(str ,arr) 把数组中的元素全部转化为str类型Some pionts:map(...
2020-03-14 13:20:23
202
原创 codewar_Dubstep(指定字符串替换问题)
要求:给定一个字符串,将给定字符串中的‘WUB’ 全部变成 ‘ ’字符串最后不要有空格示例:Input:“WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB”Output: “WE ARE THE CHAMPIONS MY FRIEND”想法及学习:改变有两种方法,一种是_遍历字符串,把符合的放进一个新的数组_,显然比较蠢,不...
2020-03-13 13:30:06
155
原创 codewars_Categorize New Member
goal: Output will consist of a list of string values (in Haskell: Open or Senior) stating whether the respective member is to be placed in the senior or open category.’Senior’:To be a senior, a membe...
2020-03-12 13:24:46
154
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人