摘要:
https://leetcode-cn.com/problems/roman-to-integer/ import java.util.Map; class Solution { public int romanToInt(String s) { int res = 0; Map<Character 阅读全文
摘要:
https://leetcode-cn.com/problems/integer-to-roman/ class Solution { public String intToRoman(int num) { String[] str = {"I","IV","V","IX","X","XL","L" 阅读全文
摘要:
https://leetcode-cn.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/submissions/ 水个分数 public class Solution { public int numWay 阅读全文
摘要:
https://leetcode-cn.com/problems/xor-queries-of-a-subarray/ 缓存一下 class Solution { public int[] xorQueries(int[] arr, int[][] queries) { int n = arr.le 阅读全文
摘要:
https://leetcode-cn.com/problems/decode-xored-permutation/ class Solution { public int[] decode(int[] encoded) { int n = encoded.length + 1; int total 阅读全文
摘要:
https://leetcode-cn.com/problems/leaf-similar-trees/ class Solution { public boolean leafSimilar(TreeNode root1, TreeNode root2) { List<Integer> list1 阅读全文
摘要:
https://leetcode-cn.com/problems/minimum-number-of-days-to-make-m-bouquets/ 通过题目可以发现,最终结果在最大值和最小值之间,另外,1 ⇐ bloomDay[i] ⇐ 10^9,可以考虑使用二分法解决这种类型的问题。 二分法对 阅读全文
摘要:
https://leetcode-cn.com/problems/find-minimum-time-to-finish-all-jobs/ 不会做,蹭个积分就走~ class Solution { /** * 最小的 工人最大用时 */ private int minId = Integer.MA 阅读全文
摘要:
https://leetcode-cn.com/problems/xor-operation-in-an-array/ class Solution { public int xorOperation(int n, int start) { int res = 0; for(int i = 0; i 阅读全文
摘要:
https://leetcode-cn.com/problems/decode-xored-array/ /* 异或的逆运算还是异或 */ class Solution { public int[] decode(int[] encoded, int first) { int[] res = new 阅读全文