neerajnanvani / PracticeGitAndJs

Its an practice repo to create pull request and use more github features
0 stars 10 forks source link

Solved the Q1. (Reverse array in groups) in index.js file and Q2. (Leaders in an array) in file index2.js . #11

Closed ravikant2707 closed 2 years ago

ravikant2707 commented 2 years ago

Solved both the question first and second. In first answer code will reverse each possible pair of 3 and directly reverse the remaining number and will return the required output array. In second answer I am comparing each number in array with the number which is right side of that number. logic( arr[i]>=arr[i+1]); output- array of all leaders.