题目:Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of...
分类:
编程语言 时间:
2015-06-02 11:07:33
阅读次数:
353
Linked List Cycle
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
解题思路:
1、最基本的办法是用一个set来存储所有已经出现过的指针。若出现重复,则表示有环,若没有重复,则没有环...
分类:
其他好文 时间:
2015-06-02 00:29:05
阅读次数:
135
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet"...
分类:
其他好文 时间:
2015-06-01 22:47:24
阅读次数:
159
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of ...
分类:
移动开发 时间:
2015-05-31 12:29:50
阅读次数:
146
Palindrome Number
题目:
Determine whether an integer is a palindrome. Do this without extra space. 题意:
判断一个整数是否是回文的,要求不使用额外的空间 思路:
简单起见我用的python,先判断是否为0,或者负数,若不是则转化为字符串,然后利用切片截取两段,反转其中一个比较是...
分类:
其他好文 时间:
2015-05-28 09:37:01
阅读次数:
125
先上题目:
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" a...
分类:
编程语言 时间:
2015-05-28 09:32:29
阅读次数:
206
leetcode新题,另外似乎是L家面经题Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett....
分类:
其他好文 时间:
2015-05-28 07:05:18
阅读次数:
115
题目描述
Given a binary tree, determine if it is a valid binary search tree (BST)....
分类:
其他好文 时间:
2015-05-27 21:14:02
阅读次数:
175
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan...
分类:
编程语言 时间:
2015-05-26 20:30:35
阅读次数:
172
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 given sum.Fo...
分类:
其他好文 时间:
2015-05-26 11:58:25
阅读次数:
117