摘要:
34. 在排序数组中查找元素的第一个和最后一个位置 class Solution { public int[] searchRange(int[] nums, int target) { if (nums.length == 0) return new int[]{-1, -1}; // 搜左边界 阅读全文
posted @ 2022-11-11 14:21
Eiffelzero
阅读(25)
评论(0)
推荐(0)
摘要:
35. 搜索插入位置 class Solution { public int searchInsert(int[] nums, int target) { int l = 0, r = nums.length - 1; while (l < r) { int mid = l + ((r - l) > 阅读全文
posted @ 2022-11-11 13:03
Eiffelzero
阅读(24)
评论(0)
推荐(0)
摘要:
1704. 判断字符串的两半是否相似 class Solution { public boolean halvesAreAlike(String s) { Set<Character> set = new HashSet<>(); set.add('a'); set.add('e'); set.ad 阅读全文
posted @ 2022-11-11 11:04
Eiffelzero
阅读(18)
评论(0)
推荐(0)

浙公网安备 33010602011771号