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 simpleArraySum function below. | |
*/ | |
int simpleArraySum(vector<int> ar) { |
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; | |
// Complete the diagonalDifference function below. | |
int diagonalDifference(vector<vector<int>> arr) { | |
int result = 0; | |
for(int i =0; i < arr.size();i++) { | |
result += arr[i][i] - arr[i][arr.size()-1 -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> | |
#include <stdio.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the plusMinus function below. | |
void plusMinus(vector<int> arr) { | |
vector<int> result{0,0,0}; |
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> | |
#include <stdio.h> | |
using namespace std; | |
// Complete the staircase function below. | |
void staircase(int n) { | |
for (int i=0; i < n; i++) { | |
for (int j=0; j < n-i-1; j++) printf(" "); | |
for (int k=0; k < i+1; k++) printf("#"); |
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); | |
void insertionSort(vector<int>& arr) { | |
int key, j; | |
for (int i = 1; i < arr.size(); 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; | |
vector<string> split_string(string); | |
void insertionSort(vector<int>& arr) { | |
int key, j; | |
for (int i = 1; i < arr.size(); 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 *subTimeString(string s, string str_arr[], int &str_cnt) { | |
str_cnt = 0; | |
char *str_buff = new char[s.length()]; | |
strcpy(str_buff, s.c_str()); | |
char *tok = strtok(str_buff, ":"); |
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; | |
/* | |
* Complete the gradingStudents function below. | |
*/ | |
vector<int> gradingStudents(vector<int> grades) { | |
vector<int> result; | |
result.reserve(grades.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 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; |
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"; |
OlderNewer