- 博客(2)
- 资源 (1)
- 收藏
- 关注
原创 【python】LeetCode刷题 566. Reshape the Matrix
class Solution(object): def matrixReshape(self, nums, r, c): nums_row=len(nums) nums_col=len(nums[0]) if nums_row*nums_col==r*c: tmp=[num for row in nums for nu
2017-09-23 21:45:21
283
原创 leetcode Reverse Words in a String III python解法
class Solution(object): def reverseWords(self, s): return ' '.join(s.split()[::-1])[::-1] 如果输入为"Let's take LeetCode contest" 则s.split() 是将原始的字符串,以空格分割成列表 结果:["Let's", 'take', 'Lee
2017-09-23 19:08:14
291
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人