leetcode Submission Details】的更多相关文章

Description: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are+, - and *. Example 1 Input: "2-1-1". ((2-1)-1) = 0 (2-(1-1))…
代码: #include<iostream> #include<vector> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; ListNode* rotateRight(ListNode* head, int k) { if (head == NULL) return head; ListNode * p = hea…
最先看到这一题,直觉的解法就是len从1到s1.size()-1,递归调用比較s1和s2长度为len的子串是否相等.以及剩余部分是否相等. 将s1分成s1[len + rest],分别比較s2[len + rest]和s2[rest + len] 代码例如以下: bool isScramble(string s1, string s2) { return find(s1, s2); } bool find(string s1, string s2) { if (s1.compare(s2) ==…
Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are similar. For example, words1 = ["great", "acting", "skills"] and words2 = [&…
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? int climbStairs(int n) { int step[n]; int i = 0; if(n <= 2) return n; step[0] = 1; s…
Max Points on a Line Submission Details 27 / 27 test cases passed. Status: Accepted Runtime: 472 ms Submitted: 0 minutes ago Submitted Code Language: java   Edit Code         /** * Definition for a point. * class Point { * int x; * int y; * Point() {…
[题目]: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note…
[题目]: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + (5 -> 6…
传送门 15. 3Sum My Submissions Question Total Accepted: 108534 Total Submissions: 584814 Difficulty: Medium Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the su…
1.创建mysql数据库.表.以及测试数据mysql> desc test;+-------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+----------------+| id | int(11) | NO | PRI | NULL | auto…