
LeetCode刷题
_dingzhen
一枚可爱又迷人的后端coder!
展开
-
Longest Substring Without Repeating Characters滑动窗口算法
Leetcode: Longest Substring Without Repeating CharactersGiven a string s, find the length of the longest substring without repeating characters.Example 1:Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3.Example 2:原创 2020-11-04 00:41:31 · 286 阅读 · 0 评论 -
Maximum Subarray
Maximum Subarraydescription:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1...原创 2020-04-07 22:43:52 · 313 阅读 · 0 评论 -
30-Day LeetCoding Challenge!
Welcome to the 30-Day LeetCoding Challenge!由于不平凡的2020疫情影响,全世界大部分人都呆在家里防止感染病毒,于是leecode发起了一个30天代码挑战,从4.1~4.30,下面我将开始挑战!Problem1: Single NumberGiven a non-empty array of integers, every element appea...原创 2020-04-01 23:21:17 · 404 阅读 · 0 评论 -
Reverse Linked List
Reverse Linked ListReverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iterat...原创 2020-03-31 18:05:05 · 290 阅读 · 0 评论 -
Exchange Seats
Exchange Seatsdescription:Mary is a teacher in a middle school and she has a table seat storing students’ names and their corresponding seat ids.The column id is continuous increment.Mary wants to...原创 2020-03-28 22:24:23 · 340 阅读 · 0 评论 -
Rising Temperature
Rising Temperaturedescription:Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates.+---------+------------------+---...原创 2020-03-27 16:44:48 · 259 阅读 · 0 评论 -
Delete Duplicate Emails
Delete Duplicate Emailsdescription:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.+----+------------------+| I...原创 2020-03-27 10:14:49 · 215 阅读 · 0 评论 -
Department Top Three Salaries
Department Top Three Salariesdescription:The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.+----+-------+--------+--------------+|...原创 2020-03-25 23:11:17 · 193 阅读 · 0 评论 -
Integer to Roman
Integer to Romandescription:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C...原创 2020-03-17 20:46:30 · 177 阅读 · 0 评论 -
Second Highest Salary and Nth Highest Salary
Second Highest SalaryWrite a SQL query to get the second highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+...原创 2020-03-16 11:21:45 · 124 阅读 · 0 评论 -
Combine Two Tables
[Combine Two Tables]Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+--------...原创 2020-03-16 10:23:41 · 170 阅读 · 0 评论 -
String to Integer(atoi)
String to Integer(atoi)description:Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace charac...原创 2020-03-15 21:38:39 · 199 阅读 · 0 评论 -
LeetCode刷题~
老姐让我刷LeetCode的题,就当复习数据结构了,算法和代码能力真的只有通过刷题才提升得快啊通过第一次的题也大概知道了leetcode的写题方式,不用头文件,库文件各种东西它只给你一个函数/方法, 把这个题的解决方法写入这个函数/方法即可,而且支持vim模式下的编辑,真的很方便* Two SumGiven an array of integers, return indices of...原创 2019-05-22 12:18:57 · 1020 阅读 · 0 评论