Update 刷题.md

This commit is contained in:
JZFamily 2018-06-23 18:52:35 +08:00 committed by GitHub
parent a6ee092cda
commit 8654ff9fe3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,10 +22,10 @@ update salary
### 北河
* 第一版 :392ms
```c++
class Solution {
public:
* 第一版 :392ms
```c++
class Solution {
public:
int lengthOfLongestSubstring(string s) {
map<char, short> v;
int max_num = 0;
@ -47,13 +47,13 @@ update salary
}
return max_num;
}
};
};
```
* 第2版 :32ms
```c++
class Solution {
public:
```
* 第2版 :32ms
```c++
class Solution {
public:
int lengthOfLongestSubstring(string s) {
map<char, short> v;
int max_num = 0;
@ -87,8 +87,8 @@ update salary
}
return max_num;
}
};
```
};
```
### jzf :252 ms 8
```c++
class Solution {
@ -231,10 +231,10 @@ public:
### jzf
* 第一版 超时 复杂度 n*2^n
```c++
class Solution {
public: int findTargetSumWays(vector<int>& nums, int S) {
* 第一版 超时 复杂度 n*2^n
```c++
class Solution {
public: int findTargetSumWays(vector<int>& nums, int S) {
int n = 0;
int sum = 0;
int b = 0;
@ -257,9 +257,9 @@ public:
}
return sum;
}
};
```
* 第二版
};
```
* 第二版
### kiritow 24ms 2
```c++
@ -341,7 +341,7 @@ var isPalindrome = function(x) {
* 第二版 128ms
```c++
class Solution {
int list[10],len=0,i=0;
int list[10],len=0,i=0;
public:
bool isPalindrome(int x) {
if(x<0)return false;
@ -401,10 +401,10 @@ public:
}
};
```
* 第2版 140ms
* 第2版 140ms
```c++
class Solution {
public: bool isPalindrome(int x) {
public: bool isPalindrome(int x) {
int mod;
int sh =x;
vector<int> vec;
@ -436,7 +436,7 @@ public:
}
return true;
}
};
};
```
### 北河 244ms