From 1323e37e5913ecb517099c9a5a1a2a91949bd079 Mon Sep 17 00:00:00 2001 From: sharmaayush19112000 <91747172+sharmaayush19112000@users.noreply.github.com> Date: Tue, 18 Oct 2022 01:35:47 +0530 Subject: [PATCH] Create Minimum number of jumps.cpp --- C++/Minimum number of jumps.cpp | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 C++/Minimum number of jumps.cpp diff --git a/C++/Minimum number of jumps.cpp b/C++/Minimum number of jumps.cpp new file mode 100644 index 0000000..1c7cd90 --- /dev/null +++ b/C++/Minimum number of jumps.cpp @@ -0,0 +1,48 @@ +#include +using namespace std; + + + // } Driver Code Ends +// Function to return minimum number of jumps to end of array + +class Solution{ + public: + int minJumps(int arr[], int n){ + int jumps=0,curfar=0,curend=0; + for(int i=0;i=n-1){ + break; + } + + } + if(curend>t; + while(t--) + { + int n,i,j; + cin>>n; + int arr[n]; + for(int i=0; i>arr[i]; + Solution obj; + cout<