P

@please_save_trees

c++ code to store and print all subsequence of a given string using recursion.

C++
3 years ago
#include <bits/stdc++.h> using namespace std; vector<string> all; void fun(string s,int idx, string s1,int n){ if(idx==n){ if(s1.size()==0) all.push_back("null"); all.push_back(s1); return ;

comp security

C++
3 years ago
#include <iostream> int main() { std::cout << "Hello world!" << std::endl; return 0; }//8318391015

codeforces_16_02_2023_q1

C++
3 years ago
#include <bits/stdc++.h> using namespace std; bool helmper(string s,int n){ bool ans=false; for(int i=0;i<n-1;i++){ if(s[i]==s[i+1]){ ans=true; break;

euclidean algorithm for gcd

C++
3 years ago
#include <bits/stdc++.h> using namespace std; long long helmper(long long p,long long s){ long long a,b,q,r; vector<vector<long long>> v; vector<long long> temp(4); a=p; b=s;

assign_4_dhal_sir

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int helmper(int b,int n){ vector<vector<int>> v; int z=n; int q=n/b,r=n%b,t1=0,t2=1,t3=t1-q*t2; vector<int> temp(7); //****

printing LCS aditya verma

C++
3 years ago
#include <bits/stdc++.h> using namespace std; string soln(int x,int y,string s1,string s2){ int t[x+1][y+1]; for(int i=0;i<x+1;i++) t[i][0]=0; for(int j=0;j<y+1;j++) t[0][j]=0; for(int i=1;i<x+1;i++){

codeforces try https://codeforces.com/contest/1790/problem/B

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ int n,s,r;

Partitions with Given Difference gfg

C++
3 years ago
int countPartitions(int n, int d, vector<int>& arr) { // Code here long long sum=0; for(int i=0;i<n;i++){ sum+=arr[i]; } long long target=(sum+d); if(target%2==1 || sum<d || n==1) return 0;

delete node in bst leetcode try giving error my code school

C++
3 years ago
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(n

assign1_dhal_bhai

C++
3 years ago
#include <bits/stdc++.h> using namespace std; string m= "abcdefghijklmnopqrstuvwxyz"; string enc(string s,int k1,int k2){ int n=s.size(); string ans; for(int i=0;i<n;i++){ int a=(k1*(s[i]-'a')+k2)%26;

leetcode daily challenge 17 dec 2022

C++
3 years ago
int evalRPN(vector<string>& tokens) { int n=tokens.size(); stack<int> s1; for(int i=0;i<n;i++){ if(tokens[i]=="+"||tokens[i]=="-"||tokens[i]=="*"||tokens[i]=="/"){ unsigned int t1=s1.top();

codechef q4 div3 7/12/2022

C++
3 years ago
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button

kickstart practice 11.11.2022

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; for(int i=1;i<=t;i++){ int n,x,y;

LAB 10 CN QUESTION 2

C++
3 years ago
#include <bits/stdc++.h> using namespace std; //**** string HexToBin(string hexdec) { long int i = 0; string ans; while (hexdec[i]) {

20.10.2022 CN 2

C++
3 years ago
#include <bits/stdc++.h> using namespace std; //**** string HexToBin(string hexdec) { long int i = 0; string ans; while (hexdec[i]) {

20.10.2022 CN

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int main() { string a[4],s; cin>>s; for(int i=0;i<11,i++){ int j=0;

codechef 7.10.2022 q2

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int t; cin>>t; while(t--){ int n; cin>>n;

potd 5.10.2002 gfg

C++
3 years ago
vector<int> answer; int ans=0; for(int i=0;i<Q;i++){ int qsi=query[i].length(); int count=0; for(int j=0;j<N;j++){ int lsj=li[j].length(); if(lsj>=qsi){

1.10.2022 codeforces-1734-c

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ int n;

trapping rain water

C++
3 years ago
#include <bits/stdc++.h> using namespace std; int trap(vector<int>& height) { vector<int> v1; vector<int> v2; int n=height.size();