• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
2014>
博客园    首页    新随笔    联系   管理    订阅  订阅
06 2020 档案
6.17

摘要:1014. 最佳观光组合 a[i]+a[j]-(j-i)=a[i]+i-a[j]-j j要比i大,enmerate 使数组变成类似于字典 class Solution(object): def maxScoreSightseeingPair(self, A): mx=float('-inf') zo 阅读全文
posted @ 2020-06-17 23:15 2014> 阅读(85) 评论(0) 推荐(0)
6.16

摘要:每日一题:二叉树的序列化与反序列化 https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/ class Codec: def serialize(self, root): """Encodes a tree to 阅读全文
posted @ 2020-06-16 22:03 2014> 阅读(96) 评论(0) 推荐(0)
6.15

摘要:https://leetcode-cn.com/problems/longest-common-prefix/每日一题 class Solution(object): def longestCommonPrefix(self, strs): n = len(strs) ans = '' j = 0 阅读全文
posted @ 2020-06-16 00:06 2014> 阅读(93) 评论(0) 推荐(0)
6.14

摘要:每日一题https://leetcode-cn.com/problems/sum-of-mutated-array-closest-to-target/submissions/ 首先查找问题不难想到二分法,二分法的判断函数也非常简单,就是计算满足条件的数组元素和sum和target的关系。定义左右边 阅读全文
posted @ 2020-06-14 23:37 2014> 阅读(99) 评论(0) 推荐(0)
6.13

摘要:每日一题https://leetcode-cn.com/problems/climbing-stairs/ 爬楼梯,递归 class Solution(object): def climbStairs(self, n): num=[0,1,2] if(n==1): return 1 if(n==2) 阅读全文
posted @ 2020-06-13 23:23 2014> 阅读(93) 评论(0) 推荐(0)
全世界最幸运的我

摘要:个人介绍:本人低分复旦上岸,初试倒数第二。 本科是浙江某双非,科班非跨考,16年浙江高考理科610分,我这种水平在复旦生源中算是垫底水平。大学期间打过acm吧,只有区预赛铜,邀请赛银。属实彩笔。 首先不得不说复旦对报考的学生真的很友好。因为不要外校的调剂,所以今年比较好上(可能去年神仙打架+9月改课 阅读全文
posted @ 2020-06-13 00:29 2014> 阅读(128) 评论(0) 推荐(0)
6.12

摘要:class Solution(object): def threeSum(self, nums): res_list=[] nums.sort() for i in range(len(nums)): if(nums[i]>0): break if i>0 and nums[i]==nums[i-1 阅读全文
posted @ 2020-06-12 23:24 2014> 阅读(48) 评论(0) 推荐(0)
6.10

摘要:回文数https://leetcode-cn.com/problems/palindrome-number/ class Solution(object): def isPalindrome(self, x): xx=str(x) if(xx==xx[::-1]): return True else 阅读全文
posted @ 2020-06-10 20:22 2014> 阅读(74) 评论(0) 推荐(0)
6.9

摘要:https://leetcode-cn.com/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/ 每日一题:递归 class Solution: def translateNum(self, num): if 0 <= num <= 9: retur 阅读全文
posted @ 2020-06-09 16:05 2014> 阅读(89) 评论(0) 推荐(0)
6月8日

摘要:leetcode 每日一题 https://leetcode-cn.com/problems/satisfiability-of-equality-equations/ 思路:并查集 先把所有==合并,再将所有 !=查找。如果是同一个父亲就return false 。 class Solution: 阅读全文
posted @ 2020-06-09 13:47 2014> 阅读(86) 评论(0) 推荐(0)

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