Skip to content

Commit 6c6bc87

Browse files
authored
Merge pull request doocs#93 from doocs/revert-92-revert-91-master
Revert change
2 parents cbcdd4c + 9db204d commit 6c6bc87

File tree

339 files changed

+130
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+130
-80
lines changed

β€ŽREADME.md

Lines changed: 80 additions & 80 deletions

β€ŽRename folder.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package main
2+
3+
import (
4+
"io/ioutil"
5+
"os"
6+
"strings"
7+
)
8+
9+
func main() {
10+
myfolder := "D:/workspace/bluesword/leetcode/solution"
11+
files, _ := ioutil.ReadDir(myfolder)
12+
for _, file := range files {
13+
if file.IsDir() {
14+
name := file.Name()
15+
split := strings.Split(name, ".")
16+
os.Rename(myfolder+"/"+name, myfolder+"/"+"0"+split[0]+"."+strings.TrimSpace(split[1]))
17+
} else {
18+
continue
19+
}
20+
}
21+
22+
/*file := "C:\\\\log\\\\2013.log" //源文仢路径
23+
err := os.Rename(file, "C:\\\\log\\\\install.txt") //重命名 C:\\log\\2013.log ζ–‡δ»ΆδΈΊinstall.txt
24+
if err != nil {
25+
//ε¦‚ζžœι‡ε‘½εζ–‡δ»Άε€±θ΄₯,εˆ™θΎ“ε‡Ίι”™θ―― file rename Error!
26+
fmt.Println("file rename Error!")
27+
//打印错误详细俑息
28+
fmt.Printf("%s", err)
29+
} else {
30+
//ε¦‚ζžœζ–‡δ»Άι‡ε‘½εζˆεŠŸ,εˆ™θΎ“ε‡Ί file rename OK!
31+
fmt.Println("file rename OK!")
32+
}*/
33+
}
File renamed without changes.
File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Solution {
2+
public int search(int[] A, int target) {
3+
if (A == null || A.length == 0) return -1;
4+
int low = 0,high = A.length - 1;
5+
while (low <= high) {
6+
int mid = (low + high) / 2;
7+
if (target < A[mid]) {
8+
if (A[mid] >= A[high] && target < A[low]) low = mid + 1;
9+
else high = mid - 1;
10+
} else if (target > A[mid]) {
11+
if (A[low] >= A[mid] && target > A[high]) high = mid - 1;
12+
else low = mid + 1;
13+
} else return mid;
14+
}
15+
return -1;
16+
}
17+
}

0 commit comments

Comments
Β (0)