摘要:代码: class Solution { public: / @param dividend the dividend @param divisor the divisor @return the result / int divide(int dividend, int divisor) { //
阅读全文
摘要:代码: class Solution { public: ListNode mergeKLists(vector &lists) { if(lists.empty()) return nullptr; vector heap; for(int i = 0; i != lists.size(); i
阅读全文
摘要:代码: / Definition of TreeNode: class TreeNode { public: int val; TreeNode left, right; TreeNode(int val) { this val = val; this left = this right = NUL
阅读全文
摘要:代码: class Solution { public: / @param s a string, encoded message @return an integer, the number of ways decoding / int numDecodings(string& s) { if (
阅读全文
摘要:代码: class Solution { public: / @param nums: a vector of integers @return: an integer / int maxProduct(vector& nums) { // write your code here int posM
阅读全文
摘要:代码: class Solution { public: / @param node: a node in the list should be deleted @return: nothing / void deleteNode(ListNode node) { // write your cod
阅读全文
摘要:代码: class StringUtils { public: / @param originalStr the string we want to append to @param size the target length of the string @param padChar the ch
阅读全文
摘要:代码: class Solution { public: / @param n: An integer @return: An integer / int climbStairs(int n) { // write your code here if(n == 1 || n ==0){ return
阅读全文
摘要:代码: class Solution { public: / @param A: A string includes Upper Case letters @param B: A string includes Upper Case letter @return: if string A conta
阅读全文
摘要:翻转链表 代码代码: / Definition of ListNode class ListNode { public: int val; ListNode next; ListNode(int val) { this val = val; this next = NULL; } } / class
阅读全文