Skip to content

Commit 619fc55

Browse files
refactor 1243
1 parent adac78a commit 619fc55

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

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

-31
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,6 @@
44
import java.util.List;
55
import java.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
public class _1243 {
398
public static class Solution1 {
409
public List<Integer> transformArray(int[] arr) {

0 commit comments

Comments
 (0)