Skip to content

Instantly share code, notes, and snippets.

View vaibhavt802's full-sized avatar
🏠
Working from home

Vaibhav Thakur vaibhavt802

🏠
Working from home
View GitHub Profile
#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;
#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;
#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)
#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) {
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 {
#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];
#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;
#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;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
string strings_xor(string s, string t) {
string res = "";
#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){