2022年7月21日

搜索插入位置

摘要: 介绍:搜索插入位置,如果有就返回索引,如果没有就返回他应该插入那个索引位置 package cut; public class SearchInsert { public static void main(String[] args) { int[] ints = {1, 3, 5, 6}; Sol 阅读全文

posted @ 2022-07-21 16:22 陈嘻嘻- 阅读(62) 评论(0) 推荐(0) 编辑

移除元素

摘要: 介绍:移除数组中指定元素,返回集合剩下元素的个数 public class Bracket { public static void main(String[] args) { int[] ints = {3, 2, 2, 3}; Solution3 solution3 = new Solution 阅读全文

posted @ 2022-07-21 15:07 陈嘻嘻- 阅读(15) 评论(0) 推荐(0) 编辑

去除"数组"中重复的数据

摘要: 去重:去除数据中重复的数据 public class Map_offRepetition { public static void main(String[] args) { Integer[] nums = new Integer[]{1, 1, 1, 1, 2, 1, 2, 3, 3, 3, 5 阅读全文

posted @ 2022-07-21 14:18 陈嘻嘻- 阅读(40) 评论(0) 推荐(0) 编辑

最长的公共前缀

摘要: 题目:最长的公共前缀 /** * 类型 > 最长的公共前缀 * * 我的思路: 木桶效应,找到最短的那个元素,然后进行对比 */ public class LongestCommonPrefix { public static void main(String[] args) { Solution2 阅读全文

posted @ 2022-07-21 10:14 陈嘻嘻- 阅读(30) 评论(0) 推荐(0) 编辑

导航