![](https://img-blog.csdnimg.cn/20190918140129601.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
LeetCode
力扣刷题记录
MYws.
曾许人间第一流
展开
-
力扣-03 无重复字符的最长子串
题目:代码: public static int lengthOfLongestSubstring(String s) { int start = 0; int maxlength = 0; Map<Character, Integer> hash = new HashMap<>(); char[] charArray = s.toCharArray(); for (int end = 0;原创 2022-01-13 20:25:42 · 3262 阅读 · 0 评论 -
力扣-539 最小时间差
题目:题解:class Solution { public int findMinDifference(List<String> timePoints) { if(timePoints.size()>1440){ return 0; } Collections.sort(timePoints); int minutesO = getMinutes(timePoints.get(0));原创 2022-01-18 19:37:27 · 77 阅读 · 0 评论 -
力扣-02 两数相加
Give you two non empty linked lists to represent two non negative integers. Each number is stored in reverse order, and each node can only store one digit.Please add the two numbers and return a linked list representing sum in the same form.You can assu.原创 2022-01-11 20:40:36 · 59 阅读 · 0 评论 -
力扣-01 两数之和
Given an integer array nums and an integer target value target, please find the two integers with and as the target value target in the array and return their array subscripts. You can assume that each input will correspond to only one answer. However, th.原创 2022-01-11 19:48:43 · 52 阅读 · 0 评论 -
力扣-747 至少是其他数字两倍的最大数
题目:代码:class Solution { public int dominantIndex(int[] nums) { if (nums.length < 2) { return 0; } int max = -1; int maxIndex = -1; //记录第二大数 int second = -1; for (int i = 0; i <原创 2022-01-13 17:23:39 · 82 阅读 · 0 评论 -
20201120-leetcode2
给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。您可以假设除了数字 0 之外,这两个数都不会以 0 开头。...原创 2020-11-20 18:31:29 · 120 阅读 · 0 评论 -
20201119-leetcode1
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。...原创 2020-11-19 17:23:22 · 98 阅读 · 0 评论