Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library functio ...
分类:
其他好文 时间:
2016-08-16 07:02:12
阅读次数:
160
Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f ...
分类:
其他好文 时间:
2016-08-16 00:20:25
阅读次数:
156
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such p ...
分类:
其他好文 时间:
2016-08-15 22:06:17
阅读次数:
109
36.ValidSudoku(合法数独)DetermineifaSudokuisvalid,accordingto:SudokuPuzzles-TheRules.TheSudokuboardcouldbepartiallyfilled,whereemptycellsarefilledwiththecharacter‘.‘.Apartiallyfilledsudokuwhichisvalid.Note:AvalidSudokuboard(partiallyfilled)isnotnecessarilys..
分类:
其他好文 时间:
2016-08-13 14:15:58
阅读次数:
183
Question:
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111....
分类:
其他好文 时间:
2016-08-11 22:46:44
阅读次数:
116
125.ValidPalindromeGivenastring,determineifitisapalindrome,consideringonlyalphanumericcharactersandignoringcases.Forexample,"Aman,aplan,acanal:Panama"isapalindrome."raceacar"isnotapalindrome.Note:Haveyouconsiderthatthestringmightbeempty?Thisisagoodquestiont..
分类:
其他好文 时间:
2016-08-11 16:08:32
阅读次数:
138
20.ValidParenthesesGivenastringcontainingjustthecharacters‘(‘,‘)‘,‘{‘,‘}‘,‘[‘and‘]‘,determineiftheinputstringisvalid.Thebracketsmustcloseinthecorrectorder,"()"and"()[]{}"areallvalidbut"(]"and"([)]"arenot.题目大意:括号匹配问题。思路:采用压栈出栈来处理。cla..
分类:
其他好文 时间:
2016-08-11 07:29:29
阅读次数:
131
Validate Binary Search Tree Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left sub ...
分类:
其他好文 时间:
2016-08-11 06:24:37
阅读次数:
124
题意: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in ...
分类:
其他好文 时间:
2016-08-10 22:17:33
阅读次数:
135