- 博客(17)
- 收藏
- 关注
原创 Note for Mandy Leetcode Questions
String Processingcheck if character/** * 判断是否是字母 * @param str 传入字符串 * @return 是字母返回true,否则返回false */public boolean is_alpha(String str) { if(str==null) return false; return str.matches("[a-zA-Z]+");}/** * 判断是否是字母或者数字 * @param str 传入字符串
2020-07-03 22:39:01 137
原创 2021-01-19
import java.util.Arrays; import java.util.Random;public class QuickSelect { public static int partition (int[] arr, int low, int high) { Random randomGenerator = new Random(); int randomInt = randomGenerator.ints(low, high)...
2021-01-20 15:39:51 80
原创 [8/14] M46
46. Permutationsclass Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> permute(int[] nums) { dfs(nums, new ArrayList<>()); return res; } public void
2020-08-15 04:07:17 146
原创 [8/11] M39/M40
39. Combination Sumclass Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> combinationSum(int[] candidates, int target) { backTrack(candidates, new ArrayList<>(), target,
2020-08-12 13:30:57 217
原创 [8/8] M15/M16/M17/M18/E20/E21
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar
2020-08-10 04:42:36 186
原创 [顺序刷] M6/M8/M11/E12/E14
#11https://leetcode.com/problems/container-with-most-water/submissions/Is it 1D DP?
2020-08-07 13:17:52 88
原创 7/7 [DFS] M366/M1315/M515
M366 Find Leaves of Binary Tree * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { this.val = val; } * TreeNode(int val, TreeNod
2020-07-07 13:41:18 147
原创 [7/5][DFS][Islands Problems] M959/M1254/M694/M1110/M130
M959 Regions Cut By SlashesUnion FindDFS Transformed to Number of Islands problem. int transformFactor = 3; public int regionsBySlashes(String[] grid) { int length = grid.length; int[][] islands = fillIslands(grid); int
2020-07-05 12:04:50 2134
原创 [7/3] [DFS] E695/M547/M394
Max Area of Island (Easy)Friend Circles (Medium)
2020-07-03 21:38:06 139
原创 4/23 - DFS Questions - M200
M200 - Number of Islandsjavaclass Solution { public int numIslands(char[][] grid) { if (grid == null || grid.length == 0) { return 0; } int numberOfLands = 0;...
2020-04-23 20:53:12 107
原创 DP Questions I. : H862
Dynamic Programming I.Get Familiar with ContextTwo Sum (Sliding window)use start and end pointers.H862: Shortest Subarray with Sum at Least Kclass Solution { public int shortestSubarray(int[]...
2020-04-19 23:01:16 113
原创 LC刷题4/5 - Top FB Questions - M270/ M973
4/5 Facebook Medium Questions270. Closest Binary Search Tree Value/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; *...
2020-04-06 15:05:10 166
原创 LC刷题3/28 - Top FB Questions - E824/E680
LC刷题3/28 - Top FB Questions - E824/E680824. Goat Latinclass Solution { public String toGoatLatin(String S) { String result = ""; String[] wordList = S.split(" "); int ind...
2020-03-29 00:50:47 141
原创 LC刷题3/27 - Top FB Questions - E 543/E 415/E 349
LC刷题3/27 - top fb questions - easy543. Diameter of Binary Tree * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * Tre...
2020-03-27 16:05:32 151
原创 LC刷题3/26 - Facebook Tag - E 1108/E 938/E 953
LC刷题3/261108. Defanging an IP AddressSolution938. Range Sum of BSTSolution953. Verifying an Alien DictionarySolution1108. Defanging an IP Addressclass Solution { public String defangIPaddr(Strin...
2020-03-26 20:35:24 393
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人