随笔分类 -  Leetcode Solution

My leetcode oj solution
摘要:Total Accepted: 12400 Total Submissions: 83230Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version... 阅读全文
posted @ 2015-02-21 20:14 Justin.cn 阅读(208) 评论(0) 推荐(0)
摘要:Total Accepted: 31557 Total Submissions: 116793Given a triangle, find the minimum path sum from top to bottom.Each step you may move to adjacent numbe... 阅读全文
posted @ 2015-02-18 16:33 Justin.cn 阅读(237) 评论(0) 推荐(0)
摘要:1 class Solution { 2 public: 3 int strStr(char *haystack, char *needle) { 4 5 int i = 0 , skip[256]; 6 char *str = haystack, *substr = n... 阅读全文
posted @ 2015-02-18 13:00 Justin.cn 阅读(188) 评论(0) 推荐(0)
摘要:1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), ne... 阅读全文
posted @ 2015-02-18 12:56 Justin.cn 阅读(266) 评论(0) 推荐(0)
摘要:1 #define ADDITION '+' 2 #define SUBSTRACTION '-' 3 #define MULTIPLICATION '*' 4 #define DIVISION '/' 5 6 7 class Solution { 8 public: 9 se... 阅读全文
posted @ 2015-02-18 12:52 Justin.cn 阅读(160) 评论(0) 推荐(0)
摘要:1 class Solution { 2 public: 3 vector ret; 4 string src; 5 int len; 6 unordered_set added; 7 vector restoreIpAddresses(string... 阅读全文
posted @ 2015-02-18 12:47 Justin.cn 阅读(186) 评论(0) 推荐(0)