上一页 1 2 3 4 5 6 7 ··· 17 下一页
摘要: class Solution { private String[] lessThanTwenty = { "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twe 阅读全文
posted @ 2022-04-12 07:04 阳光明媚的菲越 阅读(15) 评论(0) 推荐(0) 编辑
摘要: This problem remember one thing, using HashMap as data structure: class Solution { Map<Integer, Node> map = new HashMap<>(); public Node cloneGraph(No 阅读全文
posted @ 2022-04-12 07:03 阳光明媚的菲越 阅读(11) 评论(0) 推荐(0) 编辑
摘要: My first solution: class Solution { private int sum =0; public int sumNumbers(TreeNode root) { preOrder(root, ""); return sum; } private void preOrder 阅读全文
posted @ 2022-04-12 04:48 阳光明媚的菲越 阅读(4) 评论(0) 推荐(0) 编辑
摘要: My back tracking solution1: class Solution { List<String> res = new ArrayList<>(); Set<String> set = new HashSet<>(); public List<String> wordBreak(St 阅读全文
posted @ 2022-04-12 04:17 阳光明媚的菲越 阅读(16) 评论(0) 推荐(0) 编辑
摘要: My Solution: class Solution { public List<List<Integer>> findRLEArray(int[][] encoded1, int[][] encoded2) { int i=0,j=0; List<int[]> list = new ArrayL 阅读全文
posted @ 2022-04-12 04:01 阳光明媚的菲越 阅读(18) 评论(0) 推荐(0) 编辑
摘要: My BFS solution: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * Tr 阅读全文
posted @ 2022-04-12 01:22 阳光明媚的菲越 阅读(17) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean isStrobogrammatic(String num) { Map<Character, Character> map = new HashMap<>(); map.put('0', '0'); map.put('1', '1'); 阅读全文
posted @ 2022-04-09 13:34 阳光明媚的菲越 阅读(33) 评论(0) 推荐(0) 编辑
摘要: My PriorityQueue Solution: class Solution { public int[][] intervalIntersection(int[][] firstList, int[][] secondList) { PriorityQueue<int[]> pq1 = ne 阅读全文
posted @ 2022-04-09 13:16 阳光明媚的菲越 阅读(15) 评论(0) 推荐(0) 编辑
摘要: My Solution 1: class Solution { public ListNode mergeKLists(ListNode[] lists) { PriorityQueue<ListNode> queue = new PriorityQueue<>((a,b)-> a.val-b.va 阅读全文
posted @ 2022-04-09 06:11 阳光明媚的菲越 阅读(9) 评论(0) 推荐(0) 编辑
摘要: class Solution { public String addStrings(String num1, String num2) { StringBuilder res = new StringBuilder(); int carry = 0; int i=num1.length()-1, j 阅读全文
posted @ 2022-04-09 05:55 阳光明媚的菲越 阅读(12) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 17 下一页