摘要:
链接:https://leetcode-cn.com/problems/valid-parentheses/ 代码 class Solution { public boolean isValid(String str) { Stack<Character> stk = new Stack<>(); 阅读全文
posted @ 2020-06-13 20:36
景云ⁿ
阅读(70)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/ 代码 /** * Definition for singly-linked list. * public class ListNode { * int val; 阅读全文
posted @ 2020-06-13 20:28
景云ⁿ
阅读(50)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/4sum/ 代码 class Solution { public List<List<Integer>> fourSum(int[] nums, int target) { List<List<Integer>> ans = n 阅读全文
posted @ 2020-06-13 20:19
景云ⁿ
阅读(57)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/ 代码 class Solution { private String letters[] = {" ", "", "abc", "def", "ghi 阅读全文
posted @ 2020-06-13 19:59
景云ⁿ
阅读(65)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/3sum-closest/ 代码 class Solution { public int threeSumClosest(int[] nums, int target) { int ans = nums[0] + nums[1] 阅读全文
posted @ 2020-06-13 16:23
景云ⁿ
阅读(54)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/3sum/ 代码 class Solution { public List<List<Integer>> threeSum(int[] nums) { Arrays.sort(nums); List<List<Integer>> 阅读全文
posted @ 2020-06-13 16:12
景云ⁿ
阅读(85)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/longest-common-prefix/ 代码 class Solution { public String longestCommonPrefix(String[] strs) { if (strs.length == 0 阅读全文
posted @ 2020-06-13 15:51
景云ⁿ
阅读(71)
评论(0)
推荐(0)
摘要:
链接:https://leetcode-cn.com/problems/roman-to-integer/ 代码 class Solution { public int romanToInt(String s) { int ans = 0; HashMap<Character, Integer> m 阅读全文
posted @ 2020-06-13 15:43
景云ⁿ
阅读(100)
评论(0)
推荐(0)

浙公网安备 33010602011771号