上一页 1 2 3 4 5 6 ··· 59 下一页
摘要: https://leetcode.cn/problems/k-th-smallest-in-lexicographical-order/solution/pythonjavajavascriptgo-di-gui-by-himymbe-5mq5/ func findKthNumber(n int, 阅读全文
posted @ 2022-08-18 18:36 知道了呀~ 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/questionTerminal/2b317e02f14247a49ffdbdba315459e7来源:牛客网 牛客项目发布项目版本时会有版本号,比如1.02.11,2.14.4等等 现在给你2个版本号version1和version2,请你比 阅读全文
posted @ 2022-07-15 15:59 知道了呀~ 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2022-07-12 16:26 知道了呀~ 阅读(82) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.cn/problems/reorder-list/solution/zhong-pai-lian-biao-by-leetcode-solution/ /** * Definition for singly-linked list. * type ListNode 阅读全文
posted @ 2022-07-12 12:11 知道了呀~ 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2022-07-12 11:18 知道了呀~ 阅读(115) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.cn/problems/generate-parentheses/solution/-by-1978-7-owhs/ /** * @name: 括号生成 * @param {int} n 括号的个数 * @return {*} */ func generatePar 阅读全文
posted @ 2022-07-11 14:56 知道了呀~ 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2022-07-11 14:44 知道了呀~ 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2022-07-10 22:08 知道了呀~ 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2022-07-09 22:26 知道了呀~ 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 一、求数组局部最大值 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 阅读全文
posted @ 2022-07-08 14:43 知道了呀~ 阅读(262) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 59 下一页
点击右上角即可分享
微信分享提示