摘要:
1832. 判断句子是否为全字母句 class Solution { public boolean checkIfPangram(String sentence) { char[] chars = sentence.toCharArray(); int[] flag = new int[30]; f 阅读全文
摘要:
1827. 最少操作使数组递增 class Solution { public int minOperations(int[] nums) { int n = nums.length; int res = 0; for(int i = 1; i < n ; i++) { if(nums[i] <= 阅读全文
摘要:
(1691. 堆叠长方体的最大高度)[https://leetcode.cn/problems/maximum-height-by-stacking-cuboids/description/] class Solution { public int maxHeight(int[][] cuboids 阅读全文
摘要:
1780. 判断一个数字是否可以表示成三的幂的和 题解: 10进制数能否转换成3进制 class Solution { public boolean checkPowersOfThree(int n) { int[] a = new int[20]; a[0] = 1; for (int i = 1 阅读全文
摘要:
1775. 通过最少操作次数使数组的和相等 class Solution { public int minOperations(int[] nums1, int[] nums2) { int n = nums1.length, m = nums2.length; if (6 * n < m || 6 阅读全文
摘要:
1812. 判断国际象棋棋盘中一个格子的颜色 class Solution { public boolean squareIsWhite(String str) { int a = str.charAt(0) - 'a' + 1; int b = str.charAt(1) - '0'; retur 阅读全文
摘要:
1805. 字符串中不同整数的数目 class Solution { public int numDifferentIntegers(String word) { char[] chars = word.toCharArray(); int n = chars.length; Set<String> 阅读全文
摘要:
1774. 最接近目标价格的甜点成本 暴力 class Solution { List<Integer> list = new ArrayList<>(); int m; int t; public int closestCost(int[] baseCosts, int[] toppingCost 阅读全文
摘要:
1796. 字符串中第二大的数字 class Solution { public int secondHighest(String s) { int max1 = -1; int max2 = -1; char[] ch = s.toCharArray(); int n = ch.length; f 阅读全文
摘要:
1769. 移动所有球到每个盒子所需的最小操作数 class Solution { public int[] minOperations(String boxes) { char[] chars = boxes.toCharArray(); int n = chars.length; int[] r 阅读全文