摘要: I. 数组中数字出现的次数 解法一: 哈希表 public int[] singleNumbers(int[] nums) { int[] ans = new int[2]; Map<Integer,Boolean> map = new HashMap<>(); for(int i = 0 ; i 阅读全文
posted @ 2020-07-13 14:34 贼心~不死 阅读(106) 评论(0) 推荐(0) 编辑
摘要: public int maxSubArray(int[] nums) { int n = nums.length; int[] dp = new int[n+1]; int ans = Integer.MIN_VALUE; for(int i = 1 ; i<= n ; i++) { dp[i] = 阅读全文
posted @ 2020-07-13 09:43 贼心~不死 阅读(92) 评论(0) 推荐(0) 编辑
摘要: public char firstUniqChar(String s) { if(s.equals(" "))return ' '; int[] arr = new int[26]; for(int i = 0 ; i < s.length() ; i++) { arr[s.charAt(i) - 阅读全文
posted @ 2020-07-13 09:12 贼心~不死 阅读(105) 评论(0) 推荐(0) 编辑