leetcode-ye

导航

2022年7月21日 #

LeetCode No.3 无重复字符的最长子串

摘要: import java.util.HashSet; class Solution { public int lengthOfLongestSubstring(String s) { // 滑动窗口 int maxLength = 0; for (int i = 0; i < s.length(); 阅读全文

posted @ 2022-07-21 01:39 XunweiYe 阅读(21) 评论(0) 推荐(0) 编辑

2022年6月14日 #

LeetCode No.2 两数相加

摘要: 模拟法 阅读全文

posted @ 2022-06-14 12:11 XunweiYe 阅读(16) 评论(0) 推荐(0) 编辑

2022年6月11日 #

LeetCode No.1 两数之和

摘要: 1. 暴力法遍历数组 class Solution { public int[] twoSum(int[] nums, int target) { int[] ans = new int[2]; for (int i = 0; i < nums.length; i ++) { for (int j 阅读全文

posted @ 2022-06-11 15:27 XunweiYe 阅读(14) 评论(0) 推荐(0) 编辑