Write an algorithm to determine if a number is “happy”. A happy number is a number defined …
分类:LeetCode题目解答
[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…
[LeetCode] Length of Last Word 求末尾单词的长度
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', …
[LeetCode] UTF-8 Validation 编码验证
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: For 1-byte charact…
leetcode690
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个保存员工信息的数据结构,它包含了员工唯一的id,重要度 和 直系下属的id。 比如,员工1是员工2的领导,员工2是员工3…
44. Wildcard Matching
44. Wildcard Matching 题目 Implement regular expression matching with support for '.' and '*'. '.' Matches any s…
152. Maximum Product Subarray
欢迎fork and star:Nowcoder-Repository-github 152. Maximum Product Subarray 题目 Find the contiguous subarray withi…
[LeetCode] Self Dividing Numbers 自整除数字
A self-dividing number is a number that is divisible by every digit it contains. For example,…
[LeetCode] Find Peak Element 求数组的局部峰值
A peak element is an element that is greater than its neighbors. Given an input array nums, where&…
[LeetCode] Majority Element 求众数
Given an array of size n, find the majority element. The majority element is the element that appe…