
leetcode
风影楼c
这个作者很懒,什么都没留下…
展开
-
leetcode刷题记录——771. Jewels and Stones
题目解析:输入参数为两个字符串,求第二个字符串中有几个字符包含于第一个字符串。 解法一:contains()方法 class Solution { public int numJewelsInStones(String J, String S) { int num = 0; int length = S.length(); for...原创 2018-09-26 23:13:52 · 182 阅读 · 0 评论 -
leetcode刷题记录——807. Max Increase to Keep City Skyline
题目解析:将一个二维数组进行调整,将每一个数调整为不超过其所在行中最大数及其所在列中最大数的最大值,返回调整整个数组所增加的总int值。 解法: class Solution { public int maxIncreaseKeepingSkyline(int[][] grid) { int row_ = grid.length; int c...原创 2018-09-27 00:00:07 · 110 阅读 · 0 评论 -
leetcode刷题记录——78. 子集
题目描述:给定一组不含重复元素的整数数组nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 错误解法1: public static List<List<Integer>> subsets(int[] nums) { List<List<Integer>> result = new Arra...原创 2019-08-30 11:45:53 · 136 阅读 · 0 评论