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 <initializer_list> | |
#include<bits/stdc++.h> | |
using namespace std; | |
vector<int> longestDistinctKSubarray(vector<int> nums, int k) { | |
vector<int> ret; | |
if (k == 0) | |
return ret; |
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 <string> | |
#include <map> | |
#include<bits/stdc++.h> | |
using namespace std; | |
struct Node { | |
int val; | |
Node*next=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
int consecutive_find(vector<int> arr, int n) { | |
for (size_t s = 0, e = 0; e < arr.size(); s = e) { | |
while (e < arr.size() && arr[s] == arr[e]) { | |
e++; | |
} | |
if (e - s == (size_t)n) { | |
return s; | |
} | |
} | |
return -1; |
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<bits/stdc++.h> | |
using namespace std; | |
template<class T> | |
struct sticky_streamer_t { | |
std::ostream* os = nullptr; | |
T x; | |
int order; | |
sticky_streamer_t()=default; |
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
xinput --set-prop "ETPS/2 Elantech Touchpad" "Device Accel Constant Deceleration" 1 |
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 <string> | |
#include <fstream> | |
#include <streambuf> | |
#include <ctime> | |
#include <iomanip> | |
#include <cmath> | |
#include <iostream> | |
int displayA(int n, int w) { | |
if (n == 0) return 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<iostream> | |
#include<string> | |
#include<map> | |
#include<vector> | |
using namespace std; | |
struct Node{ | |
int data; | |
Node*next=nullptr; | |
}; |
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; | |
string convert(int n) { | |
string arr[]={"mon","tue","wed","thur","fri","sat","sun"}; | |
return arr[n%7]; | |
} | |
string mon_convert(int n){ | |
string arr[]={"jan","feb","mar","april","may","june","july","aug","sep","oct","nov","dec"}; |
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
July 14 | |
July 16 | |
August 14 | |
////August 15//// | |
////August 17//// | |
////May 15//// | |
////May 16//// | |
////June 17//// |
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<vector> | |
#include<iostream> | |
using namespace std; | |
#define N 5 | |
#define M 5 | |
void zeroOutMatrix(int mat[N][M]) { | |
bool rowVisited[N] = {}; | |
bool columnVisited[M] = {}; |