2014年6月4日

LeetCode --- Roman to Integer

摘要: 题目链接将罗马数字转换为十进制整数。数据范围为:1~3999罗马数字由7种字母组成,按照特定规则可以组成任意正整数, 需要注意的是罗马数字中没有”0“.关于罗马数字具体可以看:这里附上代码: 1 class Solution { 2 public: 3 int romanToInt(stri... 阅读全文

posted @ 2014-06-04 15:48 Stomach_ache 阅读(111) 评论(0) 推荐(0)

LeetCode --- Maximum Depth of Binary Tree

摘要: 题目链接求树的最大深度附上代码: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 ... 阅读全文

posted @ 2014-06-04 15:19 Stomach_ache 阅读(127) 评论(0) 推荐(0)

LeetCode --- Minimum Path Sum

摘要: 题目链接简单倒推附上代码: 1 class Solution { 2 public: 3 int minPathSum(vector > &grid) { 4 int n = (int)grid.size(); 5 if (n == 0) return 0; ... 阅读全文

posted @ 2014-06-04 14:38 Stomach_ache 阅读(145) 评论(0) 推荐(0)

导航