
Codewars
暴躁老哥在线刷题
刷题ing
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codewars-Python-4 kyu Sum of Intervals(合并区间+集合)
https://www.codewars.com/kata/sum-of-intervals/train/python Write a function calledsumIntervals/sum_intervals()that accepts an array of intervals, and returns the sum of all the interval lengths. O...原创 2019-12-29 06:36:46 · 1324 阅读 · 0 评论 -
Codewars-Python-5 kyu Directions Reduction
给定一个由前进方向(东南西北)组成的数组,要求化简使得不会走没用的路,比如先向南再向北就是浪费时间。 https://www.codewars.com/kata/directions-reduction/python 一道简单的利用栈的题。 主要思想是: 线性扫描,如果当前元素跟栈顶元素可以相互抵消,就直接出栈;如果当前栈为空或者不能抵消,当前元素就入栈。最后返回栈。 def dirR...原创 2019-02-09 14:38:21 · 705 阅读 · 0 评论 -
Codewars-Python-6 kyu Create a frame!
Given an array of strings and a character to be used as a border, output the frame with the content inside. https://www.codewars.com/kata/create-a-frame 一道简单的字符串题。 先找出最长的单词,确定输出的frame 的宽度,然后逐行将内容按给...原创 2019-02-09 15:08:07 · 310 阅读 · 0 评论 -
Codewars-Python-6 kyu Your order, please
一道简单的字符串题,需要根据字符串内每个单词内数字的大小将字符排序,比如: "is2 Thi1s T4est 3a" --> "Thi1s is2 3a T4est" "4of Fo1r pe6ople g3ood th5e the2" --> "Fo1r the2 g3ood 4of th5e pe6ople" https://www.codewars.com/kata/55c...原创 2019-02-09 15:40:17 · 747 阅读 · 0 评论