• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Phinza
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

随笔分类 -  技巧心得

 
itertools mode 之 combinations用法
摘要:leetcode例题: 216. Combination Sum III Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be 阅读全文
posted @ 2019-01-07 03:02 Phinza 阅读(2174) 评论(0) 推荐(0)
PYTHON字典排序
摘要:新学习了一些关于字典的操作: keylst = list(myDict.keys()) #在list中列出所有的keysvallst = list(myDict.values()) #在list中列出所有的valsitelst = list(myDict.items()) #在list中列出所有的k 阅读全文
posted @ 2018-11-08 10:41 Phinza 阅读(311) 评论(0) 推荐(0)
PYTHON算法时间空间复杂度节省TRICK
摘要:节省时间复杂度: sorted + 跳过重复目标 +记忆搜索 例子:字符串的不同排列 import copy class Solution: def stringPermutation2(self, str): str = ''.join(sorted(str)) #部分版本的PY好像str只能以这 阅读全文
posted @ 2018-10-24 11:22 Phinza 阅读(375) 评论(0) 推荐(0)
 

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3