自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

低层码弱的记录站

记录些刷题或者开发遇到的问题以及解决办法

  • 博客(10)
  • 收藏
  • 关注

原创 LeetCode OJ 14 Longest Common Prefix

题目: Write a function to find the longest common prefix string amongst an array of strings. 难度: Easy 思路: 从头开始比较每个字符串,不等就停止循环即可 代码如下 class Solution { public: string longestCommonPrefix(vecto

2015-10-21 07:26:02 403

转载 LeetCode OJ 13 Roman To Integer

参考http://blog.csdn.net/jellyyin/article/details/13165731 代码如下class Solution { public: int romanToInt(string s) { map mapValue; mapValue.insert(pair('I',1)); mapValue.inser

2015-10-21 07:13:10 402

原创 LeetCode OJ 12 Integer to Roman

题目: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 难度: medium 思路: 找到罗马数字对应阿拉伯数字的规律即可。将数字对应序列从大到小排列,每次减掉可以减掉的最大数,换成对应的罗马字母即可

2015-10-21 06:35:18 546

原创 LeetCode OJ 11 Container With Most Water

题目: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i,

2015-10-21 06:16:45 437

原创 LeetCode OJ 9 Palindrome Number

题目: Determine whether an integer is a palindrome. Do this without extra space. 难度 easy 思路:每一个提取最高位和最低位进行比较即可 代码如下 using namespace std; class Solution { public: bool isPalindrome(int x) {

2015-10-21 01:28:06 429

转载 LeetCode OJ 123 Best Time to Buy and Sell Stock III

题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most k transactions. Note: Y

2015-10-21 01:07:43 471

原创 LeetCode OJ 123 Best Time to Buy and Sell Stock III

题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. Note:

2015-10-20 01:13:02 489

原创 LeetCode OJ 121 Best Time to Buy and Sell Stock

题目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of th

2015-10-19 12:33:20 423

原创 LeetCode OJ 198 House Robber

题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjac

2015-10-18 00:32:35 482

原创 LeetCode OJ 05 Longest Palindromic Substring

题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 难度:medium

2015-10-13 23:42:17 419

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除