1 2 3 4 5 ··· 8 下一页

2014年12月4日

Letter Combinations of a Phone Number

摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文

posted @ 2014-12-04 13:28 code#swan 阅读(93) 评论(0) 推荐(0)

Construct Binary Tree from Preorder and Inorder Traversal

摘要: Given preorder and inorder traversal of a tree, construct the binary tree./** * Definition for binary tree * struct TreeNode { * int val; * Tr... 阅读全文

posted @ 2014-12-04 13:27 code#swan 阅读(100) 评论(0) 推荐(0)

Jump Game II

摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文

posted @ 2014-12-04 13:24 code#swan 阅读(83) 评论(0) 推荐(0)

Sudoku Solver

摘要: Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that there will be on... 阅读全文

posted @ 2014-12-04 13:21 code#swan 阅读(190) 评论(0) 推荐(0)

Spiral Matrix

摘要: Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],... 阅读全文

posted @ 2014-12-04 13:11 code#swan 阅读(131) 评论(0) 推荐(0)

2014年12月3日

Longest Common Prefix

摘要: class Solution {public: string longestCommonPrefix(vector &strs) { int ind, tail, len, tmp; len = strs.size(); if(len == 0) re... 阅读全文

posted @ 2014-12-03 22:40 code#swan 阅读(133) 评论(0) 推荐(0)

3Sum

摘要: Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen... 阅读全文

posted @ 2014-12-03 22:40 code#swan 阅读(157) 评论(0) 推荐(0)

Longest Palindromic Substring[leetcode]

摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文

posted @ 2014-12-03 22:35 code#swan 阅读(107) 评论(0) 推荐(0)

String to Integer (atoi)

摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文

posted @ 2014-12-03 21:18 code#swan 阅读(99) 评论(0) 推荐(0)

Regular Expression Matching

摘要: Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The... 阅读全文

posted @ 2014-12-03 21:17 code#swan 阅读(106) 评论(0) 推荐(0)

1 2 3 4 5 ··· 8 下一页

导航