lichao_normal

导航

2016年12月9日 #

Longest Valid Parentheses

摘要: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo 阅读全文

posted @ 2016-12-09 10:51 lichao_normal 阅读(201) 评论(0) 推荐(1) 编辑

2016年12月7日 #

Next Permutation

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文

posted @ 2016-12-07 20:47 lichao_normal 阅读(130) 评论(0) 推荐(0) 编辑

Substring with Concatenation of All Words

摘要: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文

posted @ 2016-12-07 15:55 lichao_normal 阅读(289) 评论(0) 推荐(0) 编辑

2016年11月26日 #

Divide Two Integers

摘要: 1 int divide(int dividend, int divisor) { 2 if(divisor==0)return INT_MAX; 3 if(dividend==0)return 0; 4 long long res=0; 5 int flag=1; 6 long long d1=d 阅读全文

posted @ 2016-11-26 22:31 lichao_normal 阅读(164) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted Array

摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文

posted @ 2016-11-26 15:16 lichao_normal 阅读(184) 评论(0) 推荐(0) 编辑

2016年11月21日 #

3sum closest

摘要: 问题描述: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three int 阅读全文

posted @ 2016-11-21 16:50 lichao_normal 阅读(145) 评论(0) 推荐(0) 编辑