Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]&…
标签:LeetCode题目解答
LeetCode 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permi…
一篇文章搞懂面试中leetcode位操作算法题
Single Number落单的数 落单的数 IISingle Number II Single Number III落单的数 III Number of 1 Bits Counting Bits Reverse Bit…
LeetCode 2. Add Two Numbers
题目 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in r…
LeetCode 240. Search a 2D Matrix II
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following prope…
LeetCode 368. Largest Divisible Subset
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements i…
LeetCode 14. Longest Common Prefix
给k个字符串,求出他们的最长公共前缀(LCP) 样例 在 “ABCD” “ABEF” 和 “ACEF” 中, LCP 为 “A̶…
LeetCode 21. Merge Two Sorted Lists
题目 将两个排序链表合并为一个新的排序链表 样例 给出 1->3->8->11->15->null,2->null, 返回 1->2->3->8->11->…
LeetCode 5. Longest Palindromic Substring
Total Accepted: 200641 Total Submissions: 798974 Difficulty: Medium Contributor: LeetCode Given a string s, fi…
Reverse Nodes in k-Group解题报告
Description: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.…
LeetCode 278. First Bad Version
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest ver…
LeetCode 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money …