2022年2月25日
摘要: 题目链接:https://leetcode-cn.com/problems/count-common-words-with-one-occurrence/ 前言:没想出怎么解决这道题,参考了评论区里大佬的做法,记录下学到的东西。 一. 函数学习 1.HashMap的定义。 /*HashMap 是一个 阅读全文
posted @ 2022-02-25 11:54 SelmaS 阅读(56) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/complex-number-multiplication/ 前言:很基础的题目,主要是字符串和数字之间的互相转化。 一. 函数学习 1.字符串按子串分割 /* +、*、|、\等符号在正则表达示中有相应的不同意义,使用时要进 阅读全文
posted @ 2022-02-25 10:40 SelmaS 阅读(61) 评论(0) 推荐(0)
  2022年2月24日
摘要: 题目链接:https://leetcode-cn.com/problems/minimum-cost-of-buying-candies-with-discount/ 前言:如果有任何问题欢迎各位指正。 一. 函数学习 1.数组排序 import java.util.Arrays; Arrays.s 阅读全文
posted @ 2022-02-24 20:42 SelmaS 阅读(31) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/two-furthest-houses-with-different-colors/ 一. 函数学习 1.返回最大值。 res = Math.max(res, j - i); 二. 题解思路 思路同样很多,学习后简单总结如下 阅读全文
posted @ 2022-02-24 17:15 SelmaS 阅读(30) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/missing-number/ 前言:相对简单的一道题。 一. 函数学习 1.数组排序(升序)。 import java.util.Arrays; Arrays.sort(nums); 2.哈希集合定义及添加元素。 /*初始 阅读全文
posted @ 2022-02-24 16:05 SelmaS 阅读(45) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/student-attendance-record-i/ 前言:很简单的一道题。 一. 函数学习 1.读取字符串某一位置的字符,返回char类型。 char c = str.charAt(i); 2.字符串比较。 /*a,b 阅读全文
posted @ 2022-02-24 14:45 SelmaS 阅读(34) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/where-will-the-ball-fall/ 前言:很久没写过java代码了,每次刷题都要看很多博客查基础的函数,希望尽快掌握这些。 一. java学习 1.数组定义方式 /*长度为n的一维数组*/ int[] a = 阅读全文
posted @ 2022-02-24 12:24 SelmaS 阅读(34) 评论(0) 推荐(0)
  2022年2月23日
摘要: 题目链接:https://leetcode-cn.com/problems/reverse-only-letters/ 前言:java初学者,边做题边学习,期望与大家共同进步。 一. 函数学习 1.首先的思路是String类型转char数组,用到了toCharArray()函数。而最后将char数组 阅读全文
posted @ 2022-02-23 14:14 SelmaS 阅读(35) 评论(0) 推荐(0)
  2020年5月24日
摘要: 第一次实践作业 阅读全文
posted @ 2020-05-24 10:36 SelmaS 阅读(2285) 评论(2) 推荐(3)
  2020年4月3日
摘要: 希望下次自己不会踩这些坑了 阅读全文
posted @ 2020-04-03 06:58 SelmaS 阅读(1560) 评论(0) 推荐(0)