This file contains 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 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){ |
This file contains 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; | |
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]); |
This file contains 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
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; | |
} |
This file contains 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 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++){ |
This file contains 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 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; |
This file contains 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
/* | |
Welcome! | |
/\_/\ ( | |
( ^.^ ) _) | |
\"/ ( | |
( | | ) | |
(__d b__) | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; |
This file contains 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
/* | |
Welcome! | |
/\_/\ ( | |
( ^.^ ) _) | |
\"/ ( | |
( | | ) | |
(__d b__) | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; |
This file contains 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 main() | |
{ | |
int t; | |
scanf("%d" , &t); | |
while(t--) | |
{ |