自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Jason__Liang的博客

本人电子系,只为一学生。心喜计算机,小编以怡情。

  • 博客(8)
  • 收藏
  • 关注

原创 Leetcode 38. 数数并说

class Solution: def countAndSay(self, n): """ :type n: int :rtype: str """ S="1" for i in range(1,n): #控制外层的迭代次数 S=self.myfun(S) ...

2018-03-31 13:55:48 935

原创 python leetcode 258. 各位相加

人生苦短,我用python我感觉我这种做法太邪恶了。。。class Solution: def addDigits(self, num): """ :type num: int :rtype: int """ num=str(num)#变成字符串来进行处理 count=0 whi...

2018-03-30 19:34:26 336

原创 leetcode 171. Excel表列序号

#思路就是26进制转10进制,这样一说是不是感觉很简单了呢?class Solution(object): def titleToNumber(self, s): """ :type s: str :rtype: int """ base=ord("A")-1 count=0 f...

2018-03-30 17:13:03 246

原创 leetcode 575. 分糖果

class Solution(object): def distributeCandies(self, candies): """ :type candies: List[int] :rtype: int """ myset=set()#表示多少种类 for i in candies: ...

2018-03-30 16:58:11 566

原创 leetcode 669. 修剪二叉搜索树

class Solution(object): def trimBST(self, root, L, R): """ :type root: TreeNode :type L: int :type R: int :rtype: TreeNode """ if root is ...

2018-03-30 09:36:43 617

原创 leetcode 806. 写字符串需要的行数

class Solution(object): def numberOfLines(self, widths, S): """ :type widths: List[int] :type S: str :rtype: List[int] """ base=ord('a') #字母a的作...

2018-03-29 19:34:36 572

原创 leetcode 657. 判断路线成圈

我用了字典的方式来做这题,挺好玩的题目class Solution: def judgeCircle(self, moves): """ :type moves: str :rtype: bool """ dict={"U":(0,1), "D":(0,-1), ...

2018-03-27 22:20:28 334

原创 leetcode 766. 托普利茨矩阵

class Solution: def isToeplitzMatrix(self, matrix): """ :type matrix: List[List[int]] :rtype: bool """ m=len(matrix) n=len(matrix[0]) for i ...

2018-03-27 20:22:54 608

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除