
leetcode
竹蜻蜓飞行
有些事情本来很遥远,你争取它就会离你越来越近,直到你实现它。
展开
-
java二分查找左右边界
要注意边界!细节是魔鬼!class Solution { public int[] searchRange(int[] nums, int target) { int[] res = new int[]{-1, -1}; res[0] = findLeftBound(nums, target); res[1] = findRightBound(nums, target); return res; } pub.原创 2021-05-14 21:37:57 · 469 阅读 · 0 评论 -
回溯算法模板
class Solution { public List<List<Integer>> permute(int[] nums) { //结果集合 List<List<Integer>> res = new ArrayList<>(); //visited是标记作用 int[] visited = new int[nums.length]; //new Arra.原创 2021-05-12 09:06:43 · 163 阅读 · 0 评论 -
leetcode力扣MySQL数据库刷题(31 - 45)
(31)511. 游戏玩法分析 Iselect player_id,min(event_date) as first_loginfrom activitygroup by player_id(32)512. 游戏玩法分析 IIselect a.player_id,a.device_id from activity ajoin (select player_id,min(event_date) as first_login from activity group by player_id)原创 2020-11-23 09:45:54 · 400 阅读 · 0 评论 -
leetcode力扣MySQL数据库刷题(21 - 30)
(21)1517. 查找拥有有效邮箱的用户正则表达式的使用,令人脑大。select *from users where mail regexp '^[a-zA-A]+[a-zA-Z0-9_\\./\\-]*@leetcode\\.com$';(22)584. 寻找用户推荐人select name from customer where referee_id<>2 or referee_id is null;(23)1571. 仓库经理select w.nam原创 2020-11-22 17:07:25 · 368 阅读 · 0 评论 -
leetcode力扣MySQL数据库刷题(1 - 20)
(1) 1068. 产品销售分析 Iselect p.product_name,s.year,s.pricefrom sales sjoin product pon s.product_id=p.product_id;(2)1069. 产品销售分析 IIselect product_id,sum(quantity) as total_quantityfrom salesgroup by product_id;(3)107原创 2020-11-21 20:51:00 · 1014 阅读 · 0 评论