加载中...
分类详情
简单 分类
136-只出现一次的数字(Single Number)
原文链接: https://leetcode-cn.com/problems/single-number 英文原文Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant …
2021-12-03
141-环形链表(Linked List Cycle)
原文链接: https://leetcode-cn.com/problems/linked-list-cycle 英文原文Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by conti…
2021-12-03
155-最小栈(Min Stack)
原文链接: https://leetcode-cn.com/problems/min-stack 英文原文Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: MinStack() initializes the stack object. void push(int val) pushes th…
2021-12-03
168-Excel表列名称(Excel Sheet Column Title)
原文链接: https://leetcode-cn.com/problems/excel-sheet-column-title 英文原文Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... Example 1: I…
2021-12-03
175-组合两个表(Combine Two Tables)
原文链接: https://leetcode-cn.com/problems/combine-two-tables 英文原文Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | personId | int | | lastName | varchar | | firstName | varchar | +-------------+---------+ personI…
2021-12-03
182-查找重复的电子邮箱(Duplicate Emails)
原文链接: https://leetcode-cn.com/problems/duplicate-emails 英文原文Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | email | varchar | +-------------+---------+ id is the primary key column for this tabl…
2021-12-03
183-从不订购的客户(Customers Who Never Order)
原文链接: https://leetcode-cn.com/problems/customers-who-never-order 英文原文Table: Customers +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | +-------------+---------+ id is the primary key column fo…
2021-12-03
190-颠倒二进制位(Reverse Bits)
原文链接: https://leetcode-cn.com/problems/reverse-bits 英文原文Reverse bits of a given 32 bits unsigned integer. Note: Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signe…
2021-12-03
191-位1的个数(Number of 1 Bits)
原文链接: https://leetcode-cn.com/problems/number-of-1-bits 英文原文Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight). Note: Note that in some languages, such as Java, there is no uns…
2021-12-03
193-有效电话号码(Valid Phone Numbers)
原文链接: https://leetcode-cn.com/problems/valid-phone-numbers 英文原文Given a text file file.txt that contains a list of phone numbers (one per line), write a one-liner bash script to print all valid phone numbers. You may assume that a valid phone number m…
2021-12-03
195-第十行(Tenth Line)
原文链接: https://leetcode-cn.com/problems/tenth-line 英文原文Given a text file file.txt, print just the 10th line of the file. Example: Assume that file.txt has the following content: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Yo…
2021-12-03
197-上升的温度(Rising Temperature)
原文链接: https://leetcode-cn.com/problems/rising-temperature 英文原文Table: Weather +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | recordDate | date | | temperature | int | +---------------+---------+ id is the…
2021-12-03
202-快乐数(Happy Number)
原文链接: https://leetcode-cn.com/problems/happy-number 英文原文Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squa…
2021-12-03
205-同构字符串(Isomorphic Strings)
原文链接: https://leetcode-cn.com/problems/isomorphic-strings 英文原文Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be repl…
2021-12-03
206-反转链表(Reverse Linked List)
原文链接: https://leetcode-cn.com/problems/reverse-linked-list 英文原文Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Example 2: Input: head = [1,2] Output: [2,…
2021-12-03
228-汇总区间(Summary Ranges)
原文链接: https://leetcode-cn.com/problems/summary-ranges 英文原文You are given a sorted unique integer array nums. Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly…
2021-12-03
231-2 的幂(Power of Two)
原文链接: https://leetcode-cn.com/problems/power-of-two 英文原文Given an integer n, return true if it is a power of two. Otherwise, return false. An integer n is a power of two, if there exists an integer x such that n == 2x. Example 1: Input: n = 1 Output: …
2021-12-03