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

Commit619fc55

Browse files
refactor 1243
1 parentadac78a commit619fc55

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

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

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,6 @@
44
importjava.util.List;
55
importjava.util.stream.Collectors;
66

7-
/**
8-
* 1243. Array Transformation
9-
*
10-
* Given an initial array arr, every day you produce a new array using the array of the previous day.
11-
*
12-
* On the i-th day, you do the following operations on the array of day i-1 to produce the array of day i:
13-
*
14-
* If an element is smaller than both its left neighbor and its right neighbor, then this element is incremented.
15-
* If an element is bigger than both its left neighbor and its right neighbor, then this element is decremented.
16-
* The first and last elements never change.
17-
* After some days, the array does not change. Return that final array.
18-
*
19-
* Example 1:
20-
* Input: arr = [6,2,3,4]
21-
* Output: [6,3,3,4]
22-
* Explanation:
23-
* On the first day, the array is changed from [6,2,3,4] to [6,3,3,4].
24-
* No more operations can be done to this array.
25-
*
26-
* Example 2:
27-
* Input: arr = [1,6,3,4,3,5]
28-
* Output: [1,4,4,4,4,5]
29-
* Explanation:
30-
* On the first day, the array is changed from [1,6,3,4,3,5] to [1,5,4,3,4,5].
31-
* On the second day, the array is changed from [1,5,4,3,4,5] to [1,4,4,4,4,5].
32-
* No more operations can be done to this array.
33-
*
34-
* Constraints:
35-
* 1 <= arr.length <= 100
36-
* 1 <= arr[i] <= 100
37-
* */
387
publicclass_1243 {
398
publicstaticclassSolution1 {
409
publicList<Integer>transformArray(int[]arr) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp