Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], …
分类:LeetCode
[LeetCode] Find Smallest Letter Greater Than Target 找比目标值大的最小字母
Given a list of sorted characters letters containing only lowercase letters, and given a targ…
LeetCode | Insertion Sort List(插入法排序链表)
Sort a linked list using insertion sort. 题目解析: 链表思路不难,但是指针比较麻烦,要细心才行。这道题让我调了半天,原来是一个指针赋错了,因为用的变量p和q,导致很长时间才发现……
Day.11 Ugly Number(263)
问题描述 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whos…
115. Distinct Subsequences
欢迎fork and star:Nowcoder-Repository-github 115. Distinct Subsequences 题目 Given a string S and a string T, coun…
[LeetCode] First Missing Positive 首个缺失的正数
Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,…
[LeetCode] Rotate Function 旋转函数
Given an array of integers A and let n to be its length. Assume Bk to be …
[LeetCode] 4Sum II 四数之和之二
Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are…
【leetcode】29. Divide Two Integers 不能使用乘除法的整数除法
1. 题目 Divide two integers without using multiplication, division and mod operator. If it is overflow, return M…
【Leetcode】3. Longest Substring Without RepeatingCharacters无重最长子串
1. 题目 Given a string, find the length of the longest substring without repeating characters. Examples: Given &…
力扣(LeetCode)46
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个没有重复数字的序列,返回其所有可能的全排列。 示例: 输入: [1,2,3]输出:[ [1,2,3], [1,3,2],…
LeetCode | Balanced Binary Tree(平衡二叉树)
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is de…