1. 题目 Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] retu…
分类:LeetCode
Leetcode之974-和可被K整除的子数组(Subarray Sums Divisible by K)
前言 个人网站 公众号: 北京程序猿, 网站 : https://yaml.vip 算法题 题干 给定一个整数数组 A,返回其中元素之和可被 K 整除的(连续、非空)子数组的数目 示例 输入:A = [4,5,0,-2,…
LeetCode刷题之路 两个数组的交集
两个数组的交集【简单】 给定两个数组,编写一个函数来计算它们的交集。 示例 1: 输入: nums1 = [1,2,2,1], nums2 = [2,2] 输出: [2] 示例 2: 输入: nums1 = [4,9,5…
LeetCode刷题之Palindrome Number
Problem Determine whether an integer is a palindrome. Do this without extra space. My Solution public class So…
[LeetCode By Go 88]342. Power of Four
题目 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num…
20. Valid Parentheses
20. Valid Parentheses 题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determ…
[LeetCode] Clone Graph 无向图的复制
Clone an undirected graph. Each node in the graph contains a label and a list of its nei…
LeetCode | Sort Colors
题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same …
LeetCode | Populating Next Right Pointers in Each Node II
题目: Follow up for problem “Populating Next Right Pointers in Each Node“. What if the given tree co…
82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from t…
LeetCode | Binary Tree Maximum Path Sum(二叉树的路径最大值)
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For exampl…
520. Detect Capital
题目地址:https://leetcode.com/problems/detect-capital/description/ 题目大意:判断一个单词的大写字母是不是用法正确。 思路:很简单,先判断第一个字母,如果是大写字…