摘要: public class Solution { public ListNode mergeKLists(List<ListNode> lists) { if (lists.size() == 0) { return null; } return mergeHelper(lists, 0, lists 阅读全文
posted @ 2017-08-28 19:26 MAC10 阅读(131) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: /** * @param dividend the dividend * @param divisor the divisor * @return the result */ int divide(int dividend, int divisor) 阅读全文
posted @ 2017-08-28 19:23 MAC10 阅读(162) 评论(0) 推荐(0) 编辑
摘要: static string leftPad(string& originalStr,int size,char padChar = ''){ int len = originalStr.size(); if (size < len) { return originalStr; } int k = s 阅读全文
posted @ 2017-08-28 19:20 MAC10 阅读(146) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: string intToRoman(int num) { vector<vector<string>> strR= { {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}, {"" 阅读全文
posted @ 2017-08-28 19:19 MAC10 阅读(160) 评论(0) 推荐(0) 编辑
摘要: int getMain(int* a, int length){ int count =0; int seed = a[0]; for(int i=0; i<length; i++){ if(a[i]==seed) count++; else if(count>0) count--; else se 阅读全文
posted @ 2017-08-28 19:19 MAC10 阅读(193) 评论(0) 推荐(0) 编辑
摘要: /** * Definition of ListNode * class ListNode { * public: * int val; * ListNode *next; * ListNode(int val) { * this->val = val; * this->next = NULL; * 阅读全文
posted @ 2017-08-28 19:17 MAC10 阅读(124) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: /** * @param A: A list of integers * @return: The boolean answer */ bool func(vector<int> A, int i, int size) { if (i >= size 阅读全文
posted @ 2017-08-28 19:15 MAC10 阅读(121) 评论(1) 推荐(0) 编辑
摘要: /** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val 阅读全文
posted @ 2017-08-28 19:14 MAC10 阅读(165) 评论(0) 推荐(0) 编辑
摘要: class Solution { /** * @param board: the board @return: wether the Sudoku is valid */ public boolean isValidSudoku(char[][] board) { int r[][] = new i 阅读全文
posted @ 2017-08-28 18:32 MAC10 阅读(197) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main(int argc, char *argv[]){ char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const 阅读全文
posted @ 2017-08-28 18:30 MAC10 阅读(148) 评论(0) 推荐(0) 编辑