摘要:
网址:https://leetcode.com/problems/coin-change/ 典型的动态规划问题,类比背包问题,这就是完全背包问题 阅读全文
摘要:
网址:https://leetcode.com/problems/multiply-strings/submissions/ 参考:https://leetcode.com/problems/multiply-strings/discuss/17605/Easiest-JAVA-Solution-w 阅读全文
摘要:
网址:https://leetcode.com/problems/squares-of-a-sorted-array/ 双指针法 把左端的元素和右端的元素比较后挑出绝对值大的,将其平方放入ans中,并且将指针往中间移动 不断循环上述过程,直至两指针重合。注意处理重合位置 最后将 ans 通过 rev 阅读全文
摘要:
网址:https://leetcode.com/problems/binary-prefix-divisible-by-5/ 一次for循环遍历数组,在上次计算的基础上得到本次的结果! 阅读全文
摘要:
网址:https://leetcode.com/problems/remove-outermost-parentheses/ 使用栈的思想,选择合适的判断时机 删除最外层的括号 阅读全文
摘要:
网址:https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/ 递归调用求和,同时注意%1000000007的位置 阅读全文
摘要:
网址:https://leetcode.com/problems/camelcase-matching/ 依题意可得逻辑 阅读全文
摘要:
网址:https://leetcode.com/problems/longest-substring-without-repeating-characters/ 显然采用sliding window滑动窗口法,辅助以哈希表,判断字符是否已使用 不断扩充 j,直到 s[j] 已经使用 此时,把 i 移 阅读全文
摘要:
网址:https://leetcode.com/problems/validate-stack-sequences/ 参考:https://leetcode.com/problems/validate-stack-sequences/discuss/197667/Java-straight-forw 阅读全文
摘要:
网址:https://leetcode.com/problems/product-of-array-except-self/ 参考:https://leetcode.com/problems/product-of-array-except-self/discuss/65622/Simple-Java 阅读全文