From c4a880c5814cac3136ea2cddbd01fdeeb25d8c92 Mon Sep 17 00:00:00 2001 From: Saurabh Soni <53487124+SSoni301@users.noreply.github.com> Date: Wed, 13 May 2020 15:42:06 +0530 Subject: [PATCH] Add files via upload --- SingleNumber.cpp | 10 ++++++++++ Staircase.cpp | 10 ++++++++++ grid.cpp | 34 ++++++++++++++++++++++++++++++++++ minXORvalue.cpp | 17 +++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 SingleNumber.cpp create mode 100644 Staircase.cpp create mode 100644 grid.cpp create mode 100644 minXORvalue.cpp diff --git a/SingleNumber.cpp b/SingleNumber.cpp new file mode 100644 index 0000000..735a229 --- /dev/null +++ b/SingleNumber.cpp @@ -0,0 +1,10 @@ +#include +using namespace std; +int main() +{ +vector ar={1,2,3,1,4,2,3}; +int i=0,p=0; +for(i;i +using namespace std; +int main() +{ +int n,x; +cout<<"enter n:"; +cin>>n; +x = (-1 + sqrt(1+4*n*2))/2; +cout<<"Answer: "< +using namespace std; +int main() +{ +int a; +cout<<"enter A: "; +cin>>a; +vector> arr(a,vector(a,0)); +int i,j; +for(i=0;i=j) + { + if(i==j) + { + arr[i][j] = arr[i][j-1]; + } + else + { + arr[i][j] = arr[i-1][j] + arr[i][j-1]; + } + } + } + +} +cout<<"output is : "< +using namespace std; +int main() +{ +int i,p,n=5; +vector arr={1,5,2,4,7}; +int min = INT_MAX; +sort(arr.begin(),arr.end()); +for(i=1;i p) + min = p; + +} +cout<<"Minimum XOR Value:"<