Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non…
分类:LeetCode
[LeetCode] Sort Characters By Frequency 根据字符出现频率排序
Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tr…
[LeetCode] Beautiful Arrangement 优美排列
Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that i…
[LeetCode] Next Greater Element III 下一个较大的元素之三
Given a positive 32-bit integer n, you need to find the smallest 32-bit intege…
[LeetCode] Binary Number with Alternating Bits 有交替位的二进制数
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will alwa…
557. Reverse Words in a String III
Given a string, you need to reverse the order of characters in each word within a sentence while still preserv…
力扣(LeetCode)221
题目地址:https://leetcode-cn.com/probl…题目描述:在一个由 0 和 1 组成的二维矩阵内,找到只包含 1 的最大正方形,并返回其面积。 示例: 输入: 1 0 1 0 01 0 …
029 Divide Two Integers[M]
1 题目描述 Divide two integers without using multiplication, division and mod operator. If it is overflow, return …
232. Implement Queue using Stacks
232. Implement Queue using Stacks 题目: https://leetcode.com/problems/implement-queue-using-stacks/ 难度: Easy 这个题…
杭电oj-1005(Number Sequence)
Problem Description A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(…
Leetcode 87. Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursi…
61. Rotate List
61. Rotate List 题目 Given a list, rotate the list to the right by k places, where k is non-negative. Example: G…