mirror of
https://github.com/prdlk/leetcode.git
synced 2026-08-02 17:31:40 +00:00
docs: standardize accordion components in problem hints
This commit is contained in:
+6
-6
@@ -13,17 +13,17 @@ description: How Many Numbers Are Smaller Than the Current Number
|
|||||||
|
|
||||||
## Hints
|
## Hints
|
||||||
|
|
||||||
<Accordions type="single">
|
<Accordion type="single">
|
||||||
<Accordion title="Constraints">
|
<AccordionItem title="Constraints">
|
||||||
Constraints:
|
Constraints:
|
||||||
• `2 <= nums.length <= 500`
|
• `2 <= nums.length <= 500`
|
||||||
• `0 <= nums[i] <= 100`
|
• `0 <= nums[i] <= 100`
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
<Accordion title="Problem Statement">
|
<AccordionItem title="Problem Statement">
|
||||||
Given the array nums, for each `nums[i]` find out how many numbers in the array are smaller than it.
|
Given the array nums, for each `nums[i]` find out how many numbers in the array are smaller than it.
|
||||||
That is, for each `nums[i]` you have to count the number of valid `j`'s such that `j != i` and `nums[j] < nums[i]`.
|
That is, for each `nums[i]` you have to count the number of valid `j`'s such that `j != i` and `nums[j] < nums[i]`.
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
</Accordions>
|
</Accordion>
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -13,18 +13,18 @@ description: Sort Array by Increasing Frequency
|
|||||||
|
|
||||||
## Hints
|
## Hints
|
||||||
|
|
||||||
<Accordions type="single">
|
<Accordion type="single">
|
||||||
<Accordion title="Constraints">
|
<AccordionItem title="Constraints">
|
||||||
Constraints:
|
Constraints:
|
||||||
• `1 <= nums.length <= 100`
|
• `1 <= nums.length <= 100`
|
||||||
• `-100 <= nums[i] <= 100`
|
• `-100 <= nums[i] <= 100`
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
<Accordion title="Problem Statement">
|
<AccordionItem title="Problem Statement">
|
||||||
Given an array of integers nums, sort the array in increasing order based on the frequency of the values.
|
Given an array of integers nums, sort the array in increasing order based on the frequency of the values.
|
||||||
If multiple values have the same frequency, sort them in decreasing order.
|
If multiple values have the same frequency, sort them in decreasing order.
|
||||||
Return the sorted array.
|
Return the sorted array.
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
</Accordions>
|
</Accordion>
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -13,21 +13,21 @@ description: Top K Frequent Elements
|
|||||||
|
|
||||||
## Hints
|
## Hints
|
||||||
|
|
||||||
<Accordions type="single">
|
<Accordion type="single">
|
||||||
<Accordion title="Constraints">
|
<AccordionItem title="Constraints">
|
||||||
Constraints:
|
Constraints:
|
||||||
• `1 <= nums.length <= 10^5`
|
• `1 <= nums.length <= 10^5`
|
||||||
• `-10^4 <= nums[i] <= 10^4`
|
• `-10^4 <= nums[i] <= 10^4`
|
||||||
• `k` is in the range `[1, the number of unique elements in the array]`
|
• `k` is in the range `[1, the number of unique elements in the array]`
|
||||||
• It is guaranteed that the answer is unique.
|
• It is guaranteed that the answer is unique.
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
<Accordion title="Problem Statement">
|
<AccordionItem title="Problem Statement">
|
||||||
Given an integer array nums and an integer `k`, return the `k` most frequent elements.
|
Given an integer array nums and an integer `k`, return the `k` most frequent elements.
|
||||||
You may return the answer in any order.
|
You may return the answer in any order.
|
||||||
|
|
||||||
Follow up: Your algorithm's time complexity must be better than `O(n log n)`, where n is the array's size.
|
Follow up: Your algorithm's time complexity must be better than `O(n log n)`, where n is the array's size.
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
</Accordions>
|
</Accordion>
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ description: First Unique Character in a String
|
|||||||
|
|
||||||
## Hints
|
## Hints
|
||||||
|
|
||||||
<Accordions type="single">
|
<Accordion type="single">
|
||||||
<Accordion title="Constraints">
|
<AccordionItem title="Constraints">
|
||||||
Constraints:
|
Constraints:
|
||||||
• `1 <= s.length <= 10^5`
|
• `1 <= s.length <= 10^5`
|
||||||
• `s` consists of only lowercase English letters.
|
• `s` consists of only lowercase English letters.
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
<Accordion title="Problem Statement">
|
<AccordionItem title="Problem Statement">
|
||||||
Given a string `s`, find the first non-repeating character in it and return its index.
|
Given a string `s`, find the first non-repeating character in it and return its index.
|
||||||
If it does not exist, return `-1`.
|
If it does not exist, return `-1`.
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
</Accordions>
|
</Accordion>
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ description: Sort Characters By Frequency
|
|||||||
|
|
||||||
## Hints
|
## Hints
|
||||||
|
|
||||||
<Accordions type="single">
|
<Accordion type="single">
|
||||||
<Accordion title="Constraints">
|
<AccordionItem title="Constraints">
|
||||||
Constraints:
|
Constraints:
|
||||||
• `1 <= s.length <= 5 * 10^5`
|
• `1 <= s.length <= 5 * 10^5`
|
||||||
• `s` consists of uppercase and lowercase English letters and digits.
|
• `s` consists of uppercase and lowercase English letters and digits.
|
||||||
</Accordion>
|
</AccordionItem >
|
||||||
<Accordion title="Problem Statement">
|
<AccordionItem title="Problem Statement">
|
||||||
Given a string `s`, sort it in decreasing order based on the frequency of the characters.
|
Given a string `s`, sort it in decreasing order based on the frequency of the characters.
|
||||||
The frequency of a character is the number of times it appears in the string.
|
The frequency of a character is the number of times it appears in the string.
|
||||||
Return the sorted string. If there are multiple answers, return any of them.
|
Return the sorted string. If there are multiple answers, return any of them.
|
||||||
</Accordion>
|
</AccordionItem >
|
||||||
</Accordions>
|
</Accordion>
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user