一只后端汪
HomeArchivesCategoriesTags
  • Tags
  • leetcode
Posted 2020-09-10

Jump Game 2

问题 :https://leetcode-cn.com/problems/jump-game-ii/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/greedy/P45_1.java

Read more
Posted 2020-09-10

Bitwise ORs of Subarrays

问题 :https://leetcode-cn.com/problems/bitwise-ors-of-subarrays/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/dp/P898_1.java

Read more
Posted 2020-09-09

Jump Game

问题 :https://leetcode-cn.com/problems/jump-game/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/greedy/P55.java

Read more
Posted 2020-09-04

Single Number

问题 :https://leetcode-cn.com/problems/single-number/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/P136.java

Read more
Posted 2020-09-02

Longest Valid Parentheses

问题 :https://leetcode-cn.com/problems/longest-valid-parentheses/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/dp/P32.java

Read more
Posted 2020-09-01

First Missing Positive

问题 :https://leetcode-cn.com/problems/first-missing-positive/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/P41_2.java

要求:

间复杂度应为O(n),并且只能使用常数级别的额外空间

Read more
Posted 2020-08-16

Partition Equal Subset Sum

问题 :https://leetcode-cn.com/problems/partition-equal-subset-sum/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/P416.java

动态规划

基本思想:如果前 n 个数,组成的和是 s1、s2,此时如果再加上下一个数 next,组成的和是 0 + next、s1 + next、s2 + next。

Read more
Posted 2020-08-14

Combination Sum

问题 :https://leetcode-cn.com/problems/combination-sum/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/P39_1.java

Read more
Posted 2020-08-12

Ugly Number系列

问题 1:

https://leetcode-cn.com/problems/ugly-number/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/P263.java

问题 2:

https://leetcode-cn.com/problems/ugly-number-ii/

Read more
Posted 2020-08-12

Spiral Matrix

问题 :https://leetcode-cn.com/problems/spiral-matrix/

解:https://gitee.com/footmanff/leetcode/blob/master/src/main/java/com/footmanff/leetcode/P54.java

直接模拟旋转,处理一些边界条件比较麻烦,wrong 了好几次。

Read more
Previous
Next
  • 1
  • 2
一只后端汪

© 2025 张阿力  Powered by Hexo & Icarus

浙ICP备18005239号

×