- 博客(5)
- 收藏
- 关注
原创 Valid Parentheses C++ leetcode
题目: Valid Parentheses 要求:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct o
2015-04-27 14:33:09 328
原创 C++ 版 Longest Common Prefix leetcode提交正确。
题目: Write a function to find the longest common prefix string amongst an array of strings 思路:本题是找到字符串的最长公共前缀。把第一个字符串给pre. 比较pre与下一个字符串的字符。如此得出这2个字符串的最长公共前缀,赋给str,再拿str作为新的字符串和数组中的下一个字符串比较
2015-04-23 14:51:25 350 1
原创 C语言版 Longest Common Prefix leetcode提交正确
题目:Write a function to find the longest common prefix string amongst an array of strings. 思路:本题就是找到字符串中最长的公共前缀。 把第一个字符串给prefix,与之后的字符串比较。得到新的prefix,再比较; 解题代码: char* longestCommonPrefix(c
2015-04-23 14:49:36 645
原创 Path Sum leetcode C++
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. For example: Given the below binary tree and sum
2015-04-21 16:19:18 316 2
原创 Path Sum II C++ 实现 解题 LEETCODE
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 / \
2015-04-21 16:15:14 307
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人