Skip to content

Revert change #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
160 changes: 80 additions & 80 deletions README.md

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions Rename folder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package main

import (
"io/ioutil"
"os"
"strings"
)

func main() {
myfolder := "D:/workspace/bluesword/leetcode/solution"
files, _ := ioutil.ReadDir(myfolder)
for _, file := range files {
if file.IsDir() {
name := file.Name()
split := strings.Split(name, ".")
os.Rename(myfolder+"/"+name, myfolder+"/"+"0"+split[0]+"."+strings.TrimSpace(split[1]))
} else {
continue
}
}

/*file := "C:\\\\log\\\\2013.log" //源文件路径
err := os.Rename(file, "C:\\\\log\\\\install.txt") //重命名 C:\\log\\2013.log 文件为install.txt
if err != nil {
//如果重命名文件失败,则输出错误 file rename Error!
fmt.Println("file rename Error!")
//打印错误详细信息
fmt.Printf("%s", err)
} else {
//如果文件重命名成功,则输出 file rename OK!
fmt.Println("file rename OK!")
}*/
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions solution/0033.Search in Rotated Sorted Array/Solution.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Solution {
public int search(int[] A, int target) {
if (A == null || A.length == 0) return -1;
int low = 0,high = A.length - 1;
while (low <= high) {
int mid = (low + high) / 2;
if (target < A[mid]) {
if (A[mid] >= A[high] && target < A[low]) low = mid + 1;
else high = mid - 1;
} else if (target > A[mid]) {
if (A[low] >= A[mid] && target > A[high]) high = mid - 1;
else low = mid + 1;
} else return mid;
}
return -1;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading