摘要:
https://leetcode.cn/problems/k-th-smallest-in-lexicographical-order/solution/pythonjavajavascriptgo-di-gui-by-himymbe-5mq5/ func findKthNumber(n int, 阅读全文
摘要:
链接:https://www.nowcoder.com/questionTerminal/2b317e02f14247a49ffdbdba315459e7来源:牛客网 牛客项目发布项目版本时会有版本号,比如1.02.11,2.14.4等等 现在给你2个版本号version1和version2,请你比 阅读全文
摘要:
https://leetcode.cn/problems/split-array-into-fibonacci-sequence/solution/jiang-shu-zu-chai-fen-cheng-fei-bo-na-qi-ts6c/ func splitIntoFibonacci(str s 阅读全文
摘要:
https://leetcode.cn/problems/reorder-list/solution/zhong-pai-lian-biao-by-leetcode-solution/ /** * Definition for singly-linked list. * type ListNode 阅读全文
摘要:
https://leetcode.cn/problems/sqrtx/solution/x-de-ping-fang-gen-by-leetcode-solution/ //二分查找 某个数 func mySqrt(x int) int { l, r := 0, x ans := -1 for l 阅读全文
摘要:
https://leetcode.cn/problems/generate-parentheses/solution/-by-1978-7-owhs/ /** * @name: 括号生成 * @param {int} n 括号的个数 * @return {*} */ func generatePar 阅读全文
摘要:
https://leetcode.cn/problems/open-the-lock/solution/shou-hua-tu-jie-tu-bfs-lin-jie-guan-xi-7-ud8c/ func openLock(deadends []string, target string) int 阅读全文
摘要:
https://leetcode.cn/problems/permutations/ var ans [][]int var vis map[int]bool func permute(nums []int) [][]int { path:=make([]int,0) ans=make([][]in 阅读全文
摘要:
https://leetcode.cn/problems/maximum-subarray/ func maxSubArray(nums []int) int { maxAns:=-99999999999 len:=len(nums) ans:=0;begin:=0 le:=0;ri:=len-1 阅读全文
摘要:
一、求数组局部最大值 func findMax(nums []int) int{//只能从nums里面随机找到一个符合局部最大的数字 le:=0;ri:=len(nums)-1 for le<ri{ mid:=(le+ri)/2 if nums[mid]>nums[mid+1]{ ri=mid }e 阅读全文