Skip to content

Commit

Permalink
Arrays
Browse files Browse the repository at this point in the history
Minimum no. of Jumps to reach end of an array
  • Loading branch information
dhruviagrawal committed Mar 20, 2021
1 parent 38d14e8 commit d6332a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MinimumJumps.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <bits/stdc++.h>
using namespace std;

//Complexity O(n)
int minJumps(int a[],int n)
{
if(a[0]==0) return -1;
Expand Down Expand Up @@ -41,4 +42,4 @@ int main()
for(int i=0;i<n;i++)
cin>>a[i];
int result=minJumps(a,n);
}
}

0 comments on commit d6332a0

Please sign in to comment.