Posts

Showing posts from June, 2020

Electronics Shop | Hackerrank Solution in C++

Image
Electronics Shop | Hackerrank Solution It is an hackerrank problem you can find it by clicking  her e.    Below given solution is prepared by one of the coder of our.                                                                            Soultion in C++ #include< iostream > using   namespace  std; int  main(){      int  s,n,m,a,cost = -1;      int keyboard[ 1001 ],usb[ 1001 ];     cin >> s >> n >> m;      for ( int  i =  0 ; i < n; i++)cin >> keyboard[i];      for ( int  i...

Utopian Tree | Hackerrank Solution in C++

Image
Utopian Tree | Hackerrank Solution                                                        It is an hackerrank problem you can find it by clicking  her e.                                              Below given solution is prepared by one of the coder of our.                                                                            Soulti...

Apple and Orange | Hackerrank Solution in C++

Image
Apple and Orange | Hackerrank Solution                                                                    It is an hackerrank problem you can find it by clicking  her e.                                                          Below given solution is prepared by one of the coder of our.                                                                      ...

Counting Valleys | Hackerrank Solution in C++

Image
Counting Valleys | Hackerrank Solution              It is an hackerrank problem you can find it by clicking  her e. Below given solution is prepared by one of the coder of our.                                                                            Soultion in C++ #include< iostream > using   namespace  std; int  main() {      int  n,min= 1000 ;     cin>>n;      int  *arr =  new   int  [n];      for ( int  i= 0 ;i<n;i++)     {         cin>>arr[i]; ...

Minimum Distances | Hackerrank Solutions in C++

Image
Minimum Distances | Hackerrank Solution                It is an hackerrank problem you can find it by clicking  her e. Below given solution is prepared by one of the coder of our.                                                                            Soultion in C++ #include< iostream > using   namespace  std; int  main() {      int  n,min= 1000 ;     cin>>n;      int  *arr =  new   int  [n];      for ( int  i= 0 ;i<n;i++)     {         cin>>arr[i]; ...

Maximum Draws | Hackerrank Solution in C++

Image
Maximum Draws | Hackerrank Solution It is an hackerrank problem you can find it by clicking  here. Below given solution is prepared by one of the coder of our.                                                                            Soultion in C++ #include   < bits/stdc++.h > using   namespace  std; int  main() {      int  n;     cin>>n;      for ( int  i= 0 ;i<n;i++)     {          int  a;         cin>>a;         cout<<( 2 *(a+ 1 ))-( 1 +a)<<end...

Find the Point | hackerrank Solution in C++

Image
        Find the Point | Hackerrank Solution It is an hackerrank problem you can find it by clicking  here. Below given solution is prepared by one of the coder of our.                             Soultion in C++ #include< iostream > using   namespace  std; int  main() {      int  T;     cin >> T;      for ( int  t =  0 ; t < T; t++){          int  a,b,c,d;         cin>>a>>b>>c>>d;         cout<<( 2 *c)-a<< " " <<( 2 *d)-b<<endl;     }      return   0 ; } Hope your doubt regarding this problem is c...

Beautiful Triplets | hackerrank Solution in C++

Image
     Beautiful Triplets | hackerrank Solution It is an hackerrank problem you can find it by clicking  here. Below given solution is prepared by one of the coder of our.                               Soultion in C++                          #include< iostream > using   namespace  std; int  main() {      int  n,d,count= 0 ;     cin>>n>>d;      int  *arr;     arr =  new   int  [n];      for ( int  i= 0 ;i<n;i++)     {         cin>>arr[i];          for ( int  j= 0 ;j<i;j++)        ...

Service Lane | Hackerrank Solutions in C++

Image
         Service Lane | Hackerrank Solutions It is an hackerrank problem you can find it by clicking  here. Below given solution is prepared by one of the coder of our. Solution in C++ #include   < bits/stdc++.h > using   namespace  std; int  main() {      int  n,t;     cin>>n>>t;      int  *arr;     arr =  new   int  [n];      for ( int  q= 0 ;q<n;q++)     {         cin>>arr[q];     }      for ( int  i= 0 ;i<t;i++)     {          int  a,b;         cin>>a>>b;          int  min=INT_MAX;    ...

Chocolate Feast | Hackerrank solution in C++

Image
        Chocolate Feast | Hackerrank Solution It is an hackerrank problem you can find it by clicking  here. Below given solution is prepared by one of the coder of our. Solution in C++ #include< bits/stdc++.h > using   namespace  std; int  main() {      int  t;     cin>>t;      for ( int  i= 0 ;i<t;i++)     {          int  n,c,m;         cin>>n>>c>>m;          int  count;         count = n/c;          int  temp = count;          while (temp>=m)         {           ...

Taum and B'day | Hackerrrank solution in C++

Image
            Taum and B'day | Hackerrrank solution It is an hackerrank problem you can find it by clicking here. Below given solution is prepared by one of the coder of our. C++ SOLUTION #include< bits/stdc++.h > using   namespace  std; int  main() {      long   int  n;     cin>>n;      for ( long   int  i= 0 ;i<n;i++)     {      long   int  b,w,bc,wc,z;     cin>>b>>w;     cin>>bc>>wc>>z;      long   long   int  min;     min = b*bc + w*wc;      if ((b*bc + w*(bc+z))<min)         min= b*bc+w*(bc+z);      else   if ((b*(wc+z)+w*wc)<min)   ...