摘要:
题目链接: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
阅读(35)
评论(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
阅读(36)
评论(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
阅读(53)
评论(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
阅读(38)
评论(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
阅读(49)
评论(0)
推荐(0)
浙公网安备 33010602011771号