摘要:
7. Reverse Integer Medium Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 阅读全文
摘要:
1569. Number of Ways to Reorder Array to Get Same BST Hard 1590185Add to ListShare Given an array nums that represents a permutation of integers from 阅读全文
摘要:
1351. Count Negative Numbers in a Sorted Matrix Easy 338393Add to ListShare Given a m x n matrix grid which is sorted in non-increasing order both row 阅读全文
摘要:
如何求取两个数字的最大公约数? 原理:a和b的最大公约数,也是a和a%b的最大公约数 private int gcd(int a, int b) { //如果b为0,那么直接返回a if(b == 0) return a; //如果a可以被b整除,那么返回b if(a % b == 0) retur 阅读全文
摘要:
1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Medium 2790115Add to ListShare Given an array of integers nums and an 阅读全文
摘要:
834. Sum of Distances in Tree Hard There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given the integ 阅读全文
摘要:
1359. Count All Valid Pickup and Delivery Options Hard 1674150Add to ListShare Given n orders, each order consist in pickup and delivery services. Cou 阅读全文
摘要:
2246. Longest Path With Different Adjacent Characters Hard You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 阅读全文