Skip to content

Instantly share code, notes, and snippets.

View Nimishkhurana's full-sized avatar

Nimish Khurana Nimishkhurana

View GitHub Profile
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(i=a;i<b;i++)
#define rrep(i,b,a) for(i=b;i>=a;i--)
#define ld long double
#define ll long long
#define umapi unordered_map<int,int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#include<iostream>
#include<string.h>
using namespace std;
int main(){
int t;
cin>>t;
// cin.ignore();
while(t--){
string s;
node *reverse(struct node *head, int k)
{
node* curr=head, *prev=NULL, *last=NULL;
while(curr){
int count=0;
node *h = curr;
// h->next=NULL;
while(curr && count<k){
node* next = curr->next;
curr->next = prev;
#include <iostream>
using namespace std;
int main() {
long int t;
cin>>t;
while(t--){
long int n,m,q;
cin>>n>>m>>q;
vector<pair<int,int>> offset{{0,1},{0,-1},{1,0},{-1,0},{1,1},{-1,1},{-1,-1},{1,-1}};
bool isSafe(int i, int j){
if(i>=0 && j>=0 && i<SIZE && j<SIZE)
return true;
return false;
}
void dfs(int i, int j, int g[SIZE][SIZE], bool vis[SIZE][SIZE], int *count){
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
// Function to find number of subarrays such that
// XOR of one half is equal to the other
int findSubarrCnt(int arr[], int n)
{
// Variable to store current XOR's
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T,N;
cin>>T;
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int findSubarrCnt(int arr[], int n)
{
int ans = 0, XOR = 0;
// Array to store prefix XOR's
long long Queries (vector<int> A, int K) {
// Write your code here
int n=A.size();
int maxPrefixSum=0,maxPrefixLen=0;
long long sum=0;
for(int i=0;i<A.size();i++){
int prefixSum=0;
You just need to add some URLs to the dependency_links argument to setup().
The URLs must be either:
direct download URLs,
the URLs of web pages that contain direct download links, or
the repository’s URL