Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94ba1eb

Browse files
refactor 1313
1 parentd36fe68 commit94ba1eb

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

‎src/main/java/com/fishercoder/solutions/_1313.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,6 @@
33
importjava.util.ArrayList;
44
importjava.util.List;
55

6-
/**
7-
* 1313. Decompress Run-Length Encoded List
8-
*
9-
* We are given a list nums of integers representing a list compressed with run-length encoding.
10-
* Consider each adjacent pair of elements [a, b] = [nums[2*i], nums[2*i+1]] (with i >= 0).
11-
* For each such pair, there are a elements with value b in the decompressed list.
12-
*
13-
* Return the decompressed list.
14-
*
15-
* Example 1:
16-
* Input: nums = [1,2,3,4]
17-
* Output: [2,4,4,4]
18-
* Explanation: The first pair [1,2] means we have freq = 1 and val = 2 so we generate the array [2].
19-
* The second pair [3,4] means we have freq = 3 and val = 4 so we generate [4,4,4].
20-
* At the end the concatenation [2] + [4,4,4,4] is [2,4,4,4].
21-
*
22-
* Constraints:
23-
* 2 <= nums.length <= 100
24-
* nums.length % 2 == 0
25-
* 1 <= nums[i] <= 100
26-
* */
276
publicclass_1313 {
287
publicstaticclassSolution1 {
298
publicint[]decompressRLElist(int[]nums) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp