This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<cstdio> | |
#include<string> | |
#include<algorithm> | |
#include<numeric> | |
#include<map> | |
#include<math.h> | |
using namespace::std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CatchTheBeatEasy { | |
public: | |
string ableToCatchAll(vector <int> x, vector <int> y) | |
{ | |
vector< pair<int,int> > p(x.size()); | |
for(int i = 0; i < p.size(); i++) | |
{ | |
p[i].first = y[i]; | |
p[i].second = x[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CostOfDancing { | |
public: | |
int minimum(int K, vector <int> danceCost) | |
{ | |
long long sum = 0; | |
sort(danceCost.begin() , danceCost.end()); | |
for(int i = 0; i < K; i++) | |
{ | |
sum+= danceCost[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddMultiply { | |
public: | |
vector <int> makeExpression(int y) | |
{ | |
vector<int> v(3); | |
for(int i = -1000; i <= 1000; i++) | |
{ | |
if(i == 0 || i == 1) | |
{ | |
continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ManySquares { | |
public: | |
int howManySquares(vector <int> sticks) | |
{ | |
int check[1001]; | |
int ans = 0; | |
for(int i = 0; i < 1001; i++) | |
{ | |
check[i] = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SumOfPower { | |
public: | |
int findSum(vector <int> array) | |
{ | |
int sum = 0; | |
for(int i = 0; i < array.size(); i++) | |
{ | |
for(int j = i+1; j <= array.size(); j++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<cstdio> | |
#include<string> | |
#include<algorithm> | |
#include<numeric> | |
#include<map> | |
#include<math.h> | |
#include<stdlib.h> | |
#include<string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<cstdio> | |
#include<string> | |
#include<algorithm> | |
#include<numeric> | |
#include<map> | |
#include<math.h> | |
using namespace::std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<cstdio> | |
#include<string> | |
#include<algorithm> | |
#include<numeric> | |
#include<map> | |
#include<math.h> | |
#include<stdlib.h> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<cstdio> | |
#include<string> | |
#include<algorithm> | |
#include<numeric> | |
#include<map> | |
#include<math.h> | |
using namespace::std; |