摘要:
public class Solution { public ListNode mergeKLists(List<ListNode> lists) { if (lists.size() == 0) { return null; } return mergeHelper(lists, 0, lists 阅读全文
摘要:
class Solution { public: /** * @param dividend the dividend * @param divisor the divisor * @return the result */ int divide(int dividend, int divisor) 阅读全文
摘要:
static string leftPad(string& originalStr,int size,char padChar = ''){ int len = originalStr.size(); if (size < len) { return originalStr; } int k = s 阅读全文
摘要:
class Solution { public: string intToRoman(int num) { vector<vector<string>> strR= { {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}, {"" 阅读全文
摘要:
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 阅读全文
摘要:
/** * Definition of ListNode * class ListNode { * public: * int val; * ListNode *next; * ListNode(int val) { * this->val = val; * this->next = NULL; * 阅读全文
摘要:
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 阅读全文
摘要:
/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val 阅读全文
摘要:
class Solution { /** * @param board: the board @return: wether the Sudoku is valid */ public boolean isValidSudoku(char[][] board) { int r[][] = new i 阅读全文
摘要:
#include <iostream> using namespace std; int main(int argc, char *argv[]){ char str1[] = "abc"; char str2[] = "abc"; const char str3[] = "abc"; const 阅读全文