Ying

个人博客:http://smartsi.club/

[LeetCode]5.Longest Palindromic Substring

题目Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lon...

2015-08-28 23:08:01

阅读数:876

评论数:0

[程序员面试金典]1001.字符串变换

题目描述现有一个字典,同时给定字典中的两个字符串s和t,给定一个变换,每次可以改变字符串中的任意一个字符,请设计一个算法,计算由s变换到t所需的最少步数,同时需要满足在变换过程中的每个串都是字典中的串。 给定一个string数组dic,同时给定数组大小n,串s和串t,请返回由s到t变换所需的最少...

2015-08-11 22:34:12

阅读数:1425

评论数:0

[程序员面试金典]1002.下一个较大元素

题目描述现在我们有一个int数组,请你找出数组中每个元素的下一个比它大的元素。 给定一个int数组A及数组的大小n,请返回一个int数组,代表每个元素比他大的下一个元素,若不存在则为-1。保证数组中元素均为正整数。 测试样例: [11,13,10,5,12,21,3],7 返回:[13,2...

2015-08-11 22:29:41

阅读数:1371

评论数:0

[LeetCode]228.Summary Ranges

题目Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”...

2015-08-04 20:51:01

阅读数:1270

评论数:0

[LeetCode]230.Kth Smallest Element in a BST

题目Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ B...

2015-08-03 11:34:23

阅读数:1239

评论数:0

[LeetCode]231.Power of Two

题目Given an integer, write a function to determine if it is a power of two.

2015-08-02 09:53:18

阅读数:1006

评论数:0

[LeetCode]240.Search a 2D Matrix II

题目Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted...

2015-08-01 15:14:39

阅读数:1073

评论数:0

[LeetCode]232.Implement Queue using Stacks

题目Implement the following operations of a queue using stacks.push(x) – Push element x to the back of queue. pop() – Removes the element from in fron...

2015-08-01 08:55:14

阅读数:1184

评论数:0

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