2017年4月17日

LeetCode : Word Pattern

摘要: Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between... 阅读全文

posted @ 2017-04-17 15:16 gechen 阅读(149) 评论(0) 推荐(0) 编辑

2017年4月13日

LeetCode : Perfect Number

摘要: We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself.Now, given an integer ... 阅读全文

posted @ 2017-04-13 20:41 gechen 阅读(78) 评论(0) 推荐(0) 编辑

2017年4月12日

LeetCode : Minimum Depth of Binary Tree

摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the n... 阅读全文

posted @ 2017-04-12 15:42 gechen 阅读(93) 评论(0) 推荐(0) 编辑

2017年4月11日

剑指offer : 二维数组中的查找

摘要: 题目描述 在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。这道题方法其实有很多种,很多人第一思路就是暴力搜索,如下所示:class Solution {public... 阅读全文

posted @ 2017-04-11 23:23 gechen 阅读(103) 评论(0) 推荐(0) 编辑

LeetCode : Valid Parentheses

摘要: Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close... 阅读全文

posted @ 2017-04-11 21:23 gechen 阅读(105) 评论(0) 推荐(0) 编辑

LeetCode : Isomorphic Strings

摘要: Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All oc... 阅读全文

posted @ 2017-04-11 20:33 gechen 阅读(75) 评论(0) 推荐(0) 编辑

2017年4月9日

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 values along the path equals the giv... 阅读全文

posted @ 2017-04-09 16:18 gechen 阅读(82) 评论(0) 推荐(0) 编辑

2017年4月7日

LeetCode : Find All Anagrams in a String

摘要: Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s.Strings consists of lowercase English letters only... 阅读全文

posted @ 2017-04-07 16:35 gechen 阅读(112) 评论(0) 推荐(0) 编辑

2017年3月31日

LeetCode : Palindrome Number

摘要: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints: Could negative integers be palin... 阅读全文

posted @ 2017-03-31 14:08 gechen 阅读(88) 评论(0) 推荐(0) 编辑

LeetCode : Factorial Trailing Zeroes

摘要: Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.解释: 对n!做质因数分解n!=2... 阅读全文

posted @ 2017-03-31 13:58 gechen 阅读(78) 评论(0) 推荐(0) 编辑

导航