neerajnanvani / PracticeGitAndJs

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

solution for reverse array in groups #57

Closed saqib-vm1 closed 1 year ago

saqib-vm1 commented 1 year ago

solution for the issue close #56

saqib-vm1 commented 1 year ago

My approach for Q1 Reverse array in groups

Run a loop for the 'number of groups' times. Run a nested loop for each group to reverse the group.

// To reverse the group we can swap elements // first with last element and second with second last element and so on.. // for that we only need to run the loop for half times the length of the group.

saqib-vm1 commented 1 year ago

close #56