摘要: class Solution { // 代表一个搜索状态 class Nagoto { int x; // (x,y)为当前网格的坐标 int y; int rest; // 剩余能消除障碍的数量 Nagoto(int x, int y, int rest) { this.x = x; this.y 阅读全文
posted @ 2020-10-16 12:32 消灭猕猴桃 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 解法 双指针 定义两个指针指向数组前后,比较指向元素的平方大小,从答案数组之后向前填充 class Solution { public int[] sortedSquares(int[] A) { if (A == null) return null; int n = A.length; int[] 阅读全文
posted @ 2020-10-16 09:46 消灭猕猴桃 阅读(52) 评论(0) 推荐(0) 编辑