Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < num…
分类:LeetCode
[LeetCode] Shopping Offers 购物优惠
In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are som…
Leetcode之415-字符串相加(Add Strings)
前言 个人网站 公众号: 北京程序猿, 网站 : https://yaml.vip 算法题 题干 给定两个字符串形式的非负整数num1和num2, 计算它们的和。 说明 num1和num2的长度都小于5100。 num1…
二刷340. Longest Substring with At Most K Distinct Characters
Medium Given a string, find the length of the longest substring T that contains at most k distinct characters.…
[LeetCode By Go 69]107. Binary Tree Level Order Traversal II
题目 Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left …
3. Longest Substring Without Repeating Characters
欢迎fork and star:Nowcoder-Repository-github 3. Longest Substring Without Repeating Characters 题目 Given a string…
[LeetCode] Happy Number 快乐数
Write an algorithm to determine if a number is “happy”. A happy number is a number defined …
[LeetCode] Minimum Size Subarray Sum 最短子数组之和,Maximum Subarray 最大子数组
Given an array of n positive integers and a positive integer s, find the minimal length …
[LeetCode] Escape The Ghosts 逃离鬼魂
You are playing a simplified Pacman game. You start at the point (0, 0), and your destination…
LeetCode 226 Invert Binary Tree
题目描述 Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was ins…
Day17. Construct String from Binary Tree(606)
You need to construct a string consists of parenthesis and integers from a binary tree with the preorder trave…
[LeetCode By Go 89]367. Valid Perfect Square
题目 Given a positive integer num, write a function which returns True if num is a perfect square else False. No…