Leloz00

Results 6 comments of Leloz00

关于溢出问题,可使用以下解法 ```java class Solution { public int findMinArrowShots(int[][] points) { Arrays.sort(points, (a, b) -> { return Integer.compare(a[1], b[1]); }); int count = 1; int end = points[0][1]; for (int[] point...

Java注释版 ```java class Solution { public int minInsertions(String s) { int leftNeed=0,rightNeed=0; for (char c : s.toCharArray()) { if (c == '(') { rightNeed += 2; // 右括号需求+2 if (rightNeed%2...

写得太好了,通俗易懂,深入人心👍

Java代码注释版 ```java class Solution { public ListNode reverseList(ListNode head) { if (head == null || head.next == null) { return head; } ListNode last = reverseList(head.next); // 最深处的last会到达最后一个节点 head.next.next =...