Skip to main content

Posts

Featured

Backtracking Code with Advanced Recursion

 #include <bits/stdc++.h> using namespace std; #define nl "\n" #define int long long int #define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); bool cmp(const pair<char, int>& a, const pair<char, int>& b) {     if (a.second != b.second) {         return a.second > b.second;      }     return a.first < b.first; } vector <string> valid; void generate(string &s,int open, int close) {     if(open==0 and close==0)     {         valid.push_back(s);         return;     }     if(open>0)     {         s.push_back('(');         generate(s,open-1,close);         s.pop_back();     }     if(close>0)     {         if(open<close)         {       ...

Latest Posts

Equation for finding a pair!!!

Find the indexes using two pointer theory

How to successfully erase multiple characters from a string in inner loop !!

Maximum value among more than three variables!!

Nested Map,Multiset {printing in opposite : rbegin(),rend()}

Nested Map,Pair,Vector

Set (STL) problems solve

how to easily print all digits from one to ten in words! A trick to remember in C programming!

Bank Mangement System!

finding the subsequence of a string !