Skip to content

Instantly share code, notes, and snippets.

View coinflip.cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d" , &t);
while(t--)
{
View WordBoggle.cpp
/*
Welcome!
/\_/\ (
( ^.^ ) _)
\"/ (
( | | )
(__d b__)
*/
#include<bits/stdc++.h>
using namespace std;
View HeapSort.cpp
/*
Welcome!
/\_/\ (
( ^.^ ) _)
\"/ (
( | | )
(__d b__)
*/
#include<bits/stdc++.h>
using namespace std;
View halloween.cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin>>n;
map<int , vector<int> > mp;
for(int i = 1 ; i<=n ; i++){
int x;
View commentarybox.cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
vector<string> v;
string s;
getline(cin , s);
string st = "";
for(int i = 0 ; i<s.length() ; i++){
View somejscode.js
const currentTime = document.getElementById('timerCircle');
const currentSessionDuration = document.getElementById('sessionDuration');
const decreaseSessionTimeButton = document.getElementById('decreaseSessionTime');
function appendZeroIfNeeded(){
let currentMinutes = parseInt(currentTime.innerText.split(':')[0]);
if(currentMinutes<11){
currentSessionDuration.innerText = '0'+currentSessionDuration.innerText;
}
@zarc1411
zarc1411 / quicksort3.cpp
Created Jun 20, 2020
Quick sort 3 partition
View quicksort3.cpp
#include<bits/stdc++.h>
using namespace std;
pair<int , int> partition3(int arr[] , int l , int r){
pair<int , int> p;
int pivot = arr[l];
int high = l;
for(int i = l+1 ; i<=r; i++){
if(arr[i]<=pivot){
high++;
swap(arr[i],arr[high]);
@zarc1411
zarc1411 / knapsack.cpp
Last active Oct 12, 2020
knapsack 0/1
View knapsack.cpp
#include<bits/stdc++.h>
using namespace std;
int dp[1001][1001];
int knapsack(int val[] , int wt[] , int n , int w){
if(dp[n][w]!=-1){
return dp[n][w];
}
if(n==0 || w == 0){