![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode编码练习
绿荫夏遮阳
java后台开发
展开
-
Generate Parentheses(生成括号)
给定n对括号,编写一个函数来生成格式正确的括号的所有组合。 public class CreateParenthesis { public static List<String> generateParenthesis(int n){ List<String> list = new ArrayList<>(); chuli...原创 2019-03-19 18:55:12 · 128 阅读 · 0 评论 -
Remove Duplicates from Sorted Array
class Solution { public int removeDuplicates(int[] nums) { if(nums.length == 0)return 0; int i = 0; for(int j = 1;j<nums.length;j++){ if(nums[j] != nums[i]){...原创 2019-03-19 19:29:18 · 82 阅读 · 0 评论 -
leetcode Group Anagrams
对字符串对象进行分组,相同字母组成的字符串,排序出来的值肯定是一样的,然后以这个值为key,存放对应的相同字母拼接成的字符串数组 public class GroupAnagrams { public static List<List<String>> groupAnagrams(String[] strs) { if (strs.length ==...原创 2019-03-28 22:08:50 · 142 阅读 · 0 评论