20170904开端 今天工作任务比较轻,工作之余想要重新学习算法。于是准备从DP开始,进行一次学习。所有的概念和问题从leetcode和geeksforgeeks获取。 DP Set 1 (Overlapping Su…
分类:LeetCode
30. 串联所有单词的子串(Swift版)
一、题目 给定一个字符串 s 和一些长度相同的单词 words。找出 s 中恰好可以由 words 中所有单词串联形成的子串的起始位置。 注意子串要与 words 中的单词完全匹配,中间不能有其他字符,但不需要考虑 wo…
Leetcode之15-三数之和(3Sum)
前言 个人网站 公众号: 北京程序猿, 网站 : https://yaml.vip 算法题 题干 给定一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c , 使得 a + b + c =…
Leetcode 131. Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible …
LeetCode刷题之Two Sum
Problem Given an array of integers, return indices of the two numbers such that they add up to a specific targ…
[LeetCode] Tag Validator 标签验证器
Given a string representing a code snippet, you need to implement a tag validator to parse the code and…
LeetCode | Path Sum
题目: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the v…
LeetCode 125 Valid Palindrome
题目描述 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring ca…
[Leetcode] Sum Root to Leaf Numbers 累加叶子节点
Sum Root to Leaf Numbers Given a binary tree containing digits from 0-9 only, each root-to-leaf path could rep…
【leetcode】34. Search for a Range 给定数组的给定值的下标范围
1. 题目 Given a sorted array of integers, find the starting and ending position of a given target value. Your al…
[LintCode][System Design] Singleton
Problem More LeetCode Discussions Singleton is a most widely used design pattern. If a class has and only has …
Leetcode - Frog Jump
My code: public class Solution { public boolean canCross(int[] stones) { if (stones == null || stones.length =…