上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 28 下一页
摘要: 链接:https://leetcode-cn.com/contest/weekly-contest-193 一维数组的动态和 代码 class Solution { public: vector<int> runningSum(vector<int>& nums) { vector<int> sum 阅读全文
posted @ 2020-06-14 12:57 景云ⁿ 阅读(136) 评论(0) 推荐(0)
摘要: 链接: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 景云ⁿ 阅读(68) 评论(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 景云ⁿ 阅读(56) 评论(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 景云ⁿ 阅读(52) 评论(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 景云ⁿ 阅读(70) 评论(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 景云ⁿ 阅读(99) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/integer-to-roman/ 代码 class Solution { public String intToRoman(int num) { int values[] = {1000, 900, 500, 400, 100 阅读全文
posted @ 2020-06-12 17:04 景云ⁿ 阅读(93) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 28 下一页