自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

xutiantian1412的博客

不要总想搞个大项目

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

原创 10.5.2 (python) 动态规划字符串类LeetCode题目 —— Interleaving String & Distinct Subsequences

下面我们看两道字符串子序列的问题 subsequence,首先明白子序列是不必连续的。97.Interleaving StringGivens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.Example 1:Input: s1 = "aabcc", s2 = "dbbca", s3 ...

2020-03-29 18:19:54 254

原创 10.5.1 (python) 动态规划字符串类LeetCode题目 —— Edit Distance & Regular Expression Matching

下面学习几道字符串的题目,难度一般较大,但是也有共性,有套路,必须掌握几道经典的题目。72.Edit DistanceGiven two wordsword1andword2, find the minimum number of operations required to convertword1toword2.You have the following 3 ...

2020-03-29 14:17:34 288

原创 LeetCode刷题指南——题目精选3

7. 二叉树遍历树的概念,树的存储结构,孩子兄弟存储方式二叉树、完全二叉树的性质深度优先、广度优先遍历即先序中序后序层次遍历的递归和非递归写法(相当于6道题)101. Symmetric Tree111. Minimum Depth of Binary Tree103. Binary Tree Zigzag Level Order Traversal105. Const...

2020-03-22 00:15:38 367

原创 LeetCode刷题指南——题目精选2

这是LeetCode经典题目总结文章~第二篇4. 二分查找熟练掌握二分查找的通用格式,包括递归及非递归的写法;33. Search in Rotated Sorted Array34. Find First and Last Position of Element in Sorted Array5. 排序排序算法的分类,每种方法的时空复杂度,最好、最坏复杂度,稳定性及...

2020-03-21 23:33:25 532

原创 10.4.3 (python) 动态规划专题之股票买卖 —— Best Time to Buy and Sell Stock

这一系列涉及到LeetCode中几道关于股票stock买卖时机的题目,给出一数组,代表每天股票的价格,我们要按要求,计算你所能获取的最大利润。需要注意的是,你不能同时参与多笔交易(你必须在再次购买前出售掉之前的股票)。Say you have an array for which theithelement is the price of a given stock on dayi.De...

2020-03-15 11:27:32 618

原创 10.4.2 (python) 动态规划专题之换零钱 —— Coin Change & Perfect Squares

换零钱是一个典型的动态规划场景。322.Coin ChangeYou are given coins of different denominations and a total amount of moneyamount. Write a function to compute the fewest number of coins that you need to make up t...

2020-03-08 20:24:20 272

原创 10.4.1 (python) 动态规划专题之最长递增子序列 —— Longest Increasing Subsequence & Russian Doll Envelopes

Longest Increasing Subsequence 简称 LIS,是一个经典问题。我们看一下经典解题方法及一道应用题目。300.Longest Increasing SubsequenceGiven an unsorted array of integers, find the length of longest increasing subsequence.Exam...

2020-03-08 19:50:40 839

原创 10.3.3 (python) 动态规划数组类LeetCode题目 —— Dungeon Game & Frog Jump

来看两道 hard 级别的题目,其子问题性质很明显,就是动态规划,难点就是我们可能找不好子问题的关系式。174.Dungeon GameThe demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M ...

2020-03-08 00:06:35 259

原创 10.3.2 (python) 动态规划数组类LeetCode题目 —— Decode Ways & Range Sum Query 2D

这几道题稍微加大难度,DP的框架是不变的,关键是分析问题的结构,分析状态转移关系。91.Decode WaysA message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26...

2020-03-07 20:11:45 286

空空如也

空空如也

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

TA关注的人

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