This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
int pageCount(int n, int p) { | |
return min(p/2, n/2 - p/2); | |
} | |
int main() | |
{ |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the sockMerchant function below. | |
int sockMerchant(int n, vector<int> ar) { | |
int count = 0; | |
for(int i=0; i<n; i++){ |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
string ltrim(const string &); | |
string rtrim(const string &); | |
vector<string> split(const string &); | |
// Complete the bonAppetit function below. | |
void bonAppetit(vector<int> bill, int k, int b) { |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
bool isLeap(int year); | |
string ltrim(const string &); | |
string rtrim(const string &); | |
// Complete the dayOfProgrammer function below. | |
string dayOfProgrammer(int year) { |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
string ltrim(const string &); | |
string rtrim(const string &); | |
vector<string> split(const string &); | |
int migratoryBirds(vector<int> ar) { | |
auto pSum = new int[ar.size()](); |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the divisibleSumPairs function below. | |
int divisibleSumPairs(int n, int k, vector<int> ar) { | |
int count = 0; | |
for (int i = 0; i < n; i++) { |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
string ltrim(const string &); | |
string rtrim(const string &); | |
vector<string> split(const string &); | |
// Complete the birthday function below. | |
int birthday(vector<int> s, int d, int m) { |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the breakingRecords function below. | |
vector<int> breakingRecords(vector<int> scores) { | |
vector<int> result; | |
result.reserve(2); |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the kangaroo function below. | |
string kangaroo(int x1, int v1, int x2, int v2) { | |
if (v2 >= v1) { | |
return "NO"; |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the countApplesAndOranges function below. | |
void countApplesAndOranges(int s, int t, int a, int b, vector<int> apples, vector<int> oranges) { | |
int appleCount = 0; | |
int orangeCount =0; |
NewerOlder