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

2019年10月28日

用PYTHON实现KMP字符串匹配
摘要: 本文只讨论KMP的实现,原理可从以下网站自行阅读理解,写的非常好 http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html 阮一峰大神写的 理解后可知实现KMP最重要的是部分匹配表 阅读全文
posted @ 2019-10-28 11:13 Phinza 阅读(415) 评论(0) 推荐(0)
 
 

2019年8月24日

Container With Most Water
摘要: Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文
posted @ 2019-08-24 02:27 Phinza 阅读(115) 评论(0) 推荐(0)
 
 

2019年5月13日

Dynamic Programming_Leetcode_部分动态规划题分析
摘要: 5. Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. E 阅读全文
posted @ 2019-05-13 09:56 Phinza 阅读(241) 评论(0) 推荐(0)
 
 

2019年1月24日

单词拆分II
摘要: #单词拆分II#给一字串s和单词的字典dict,在字串中增加空格来构建一个句子,并且所有单词都来自字典。#返回所有有可能的句子。#EXAMPLE:#给一字串lintcode,字典为["de", "ding", "co", "code", "lint"]#结果为["lint code", "lint 阅读全文
posted @ 2019-01-24 11:54 Phinza 阅读(328) 评论(0) 推荐(0)
 
 

2019年1月23日

Combination Sum IV
摘要: #Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive #integer targe 阅读全文
posted @ 2019-01-23 06:06 Phinza 阅读(107) 评论(0) 推荐(0)
 
 

2019年1月21日

Largest Divisible Subset_LeetCode
摘要: #Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:#Si % Sj = 0 or 阅读全文
posted @ 2019-01-21 23:42 Phinza 阅读(119) 评论(0) 推荐(0)
 
 

2019年1月15日

Best Time to Buy and Sell Stock with Cooldown_LeetCode
摘要: #Say you have an array for which the ith element is the price of a given stock on day i.#Design an algorithm to find the maximum profit. You may compl 阅读全文
posted @ 2019-01-15 12:55 Phinza 阅读(212) 评论(0) 推荐(0)
 
Perfect Squares_LeetCode
摘要: #Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.#Example 1:#Input: n = 12# 阅读全文
posted @ 2019-01-15 06:12 Phinza 阅读(189) 评论(0) 推荐(0)
 
 

2019年1月7日

泡沫排序|bubble sort
摘要: def BubbleSort(lst): for i in range(len(lst)-1): for j in range(len(lst)-1-i): if lst[j]>lst[j+1]: lst[j],lst[j+1] = lst[j+1],lst[j] return lst 首先,不知道 阅读全文
posted @ 2019-01-07 03:56 Phinza 阅读(324) 评论(0) 推荐(0)
 
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 阅读(2153) 评论(0) 推荐(0)
 
 
下一页

公告


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