摘要:
class Solution { public int maxAreaOfIsland(int[][] grid) { int count=0; //岛屿大小 int tempcount=0; int[] dx= {0,0,1,-1};//递归 也用2个1*4 [2*5] int[] dy= {1, 阅读全文
摘要:
五分钟 内存占用大 package Leetcode; /*给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾, * 同时保持非零元素的相对顺序。 请注意 ,必须在不复制数组的情况下原地对数组进行操作。*/ public class Leetcode283 { public stati 阅读全文
摘要:
昨天2.28看了题解,今天试着写了一下。 class Solution { public int lengthOfLongestSubstring(String s) { //思路是再每个以i开头的求出无重复子串的长度 Set<Character> set = new HashSet<Charact 阅读全文