排序:
默认
按更新时间
按访问量
RSS订阅

[LeetCode] 696. 计数二进制子串

题目描述:给定一个字符串 s,计算具有相同数量0和1的非空(连续)子字符串的数量,并且这些子字符串中的所有0和所有1都是组合在一起的。重复出现的子串要计算它们出现的次数。示例 1 :输入: "00110011" 输出: 6 解释: 有6个子串具有相同数量的连续1...

2018-04-13 14:07:25

阅读数 198

评论数 0

[剑指offer] 二维数组中的查找

Description:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。Solution:class Solution { public: bool Find(int ta...

2018-03-31 01:17:02

阅读数 39

评论数 0

[LeetCode] 5. Longest Palindromic Substring

Description:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: &qu...

2018-03-24 23:48:25

阅读数 25

评论数 0

构造回文--最长回文子序列

Description:时间限制:1秒空间限制:32768K给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢?输出需要删除的字符个数。输入描述:输入数据有多组,每组包含一个字符串s,且保证:1<=s.length&amp...

2018-03-24 23:02:27

阅读数 27

评论数 0

[LeetCode] 747. Min Cost Climbing Stairs

Problem: On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb...

2018-01-03 21:03:40

阅读数 80

评论数 0

[LeetCode] 494. Target Sum

Problem: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you sh...

2017-12-21 20:36:16

阅读数 60

评论数 0

[LeetCode] 416. Partition Equal Subset Sum

Problem: Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elem...

2017-12-21 19:28:48

阅读数 53

评论数 0

[LeetCode] 650. 2 Keys Keyboard

Problem: Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step: Copy All: You can...

2017-12-13 22:34:08

阅读数 75

评论数 0

[LeetCode] 357. Count Numbers with Unique Digits

Problem: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n. Example: Given n = 2, return 91. (The answe...

2017-12-13 00:19:55

阅读数 58

评论数 0

[LeetCode] 646. Maximum Length of Pair Chain

Problem: You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair ...

2017-11-30 11:50:54

阅读数 61

评论数 0

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