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 <bits/stdc++.h> | |
#include <vector> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the minimumDistances function below. | |
int minimumDistances(vector<int> a) { | |
vector<int > v; |
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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the superDigit function below. | |
int superDigit(string n, int k) { | |
long long int sum = 0; | |
int rem = 0, 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
#include <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the equalizeArray function below. | |
int equalizeArray(vector<int> arr) { | |
unordered_map<int, int> freq; | |
for (int const &i: arr) |
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 <bits/stdc++.h> | |
using namespace std; | |
// Complete the findDigits function below. | |
int findDigits(int n) { | |
int num = n, rem = 0, count = 0; | |
while (n > 0) { | |
rem = n % 10; | |
if (rem != 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
import java.io.*; | |
import java.math.*; | |
import java.security.*; | |
import java.text.*; | |
import java.util.*; | |
import java.util.concurrent.*; | |
import java.util.regex.*; | |
public class Solution { |
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 <bits/stdc++.h> | |
#include <vector> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the quickSort function below. | |
vector<int> quickSort(vector<int> arr) { | |
int p = arr[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
#include <bits/stdc++.h> | |
using namespace std; | |
void findZigZagSequence(vector < int > a, int n){ | |
sort(a.begin(), a.end()); | |
int mid = (n)/2; | |
swap(a[mid], a[n-1]); | |
int st = mid + 1; | |
int ed = n - 2; |
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 <bits/stdc++.h> | |
using namespace std; | |
int month[15]; | |
void updateLeapYear(int year) { | |
if(year % 400 == 0) { | |
month[2] = 29; | |
} else if(year % 100 == 0) { | |
month[2] = 28; |
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 <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
string strings_xor(string s, string t) { | |
string res = ""; |
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 <bits/stdc++.h> | |
using namespace std; | |
vector<string> split_string(string); | |
// Complete the countingSort function below. | |
vector<int> countingSort(vector<int> arr) { | |
vector <int> v(100, 0); | |
for (int i : arr){ |
NewerOlder