Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3b0d001

Browse files
committed
Corrected the invalid answer: Have implemented the program to find whether the array can be made strictly increasing using the values from another array.
1 parent 78dd2e9 commit 3b0d001

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/com/raj/MakeArrayStrictlyIncreasing.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public static void main(String[] args) {
6767
for (int j : arr2) {
6868
if (arr1[i - 1] < j) {
6969
if(arr1[i] == j){
70+
/*
71+
if new value and old value are same
72+
then change the value to (index + 1)
73+
i.e. (i + 1)
74+
*/
7075
break;
7176
}
7277
arr1[i] = j;

0 commit comments

Comments
 (0)