// https://www.hackerrank.com/contests/101hack44/challenges/palindromic-subsets /* author: github.com/bokonist */ #include "bits/stdc++.h" using namespace std; /* useful utility macros */ #define MIN(a,b,res) ((a)>(b))? (res)=(b):(res)=(a) #define MAX(a,b,res) ((a)<(b))? (res)=(b):(res)=(a) #define printArray(a,l,n) for(int(i)=(l);(i)> //input from stdin #define err cerr<< //output to stderr #define nl cout<<"\n"; //newline #define NO_OF_CHARS 256 bool canFormPalindrome(string str) { if(str.length()==0) return false; int count[NO_OF_CHARS] = {0}; for (int i = 0; str[i]; i++) count[str[i]]++; int odd = 0; for (int i = 0; i < NO_OF_CHARS; i++) if (count[i] & 1) odd++; return (odd <= 1); } ll generateSubsets(string &str) { ll count=0; int len=str.length(); string sub; for(ll i=0;i< pow(2,len);i++) { for(int j=0;j'z') str[index]-='a'; } } int main() { int n; ip n; int q; ip q; string str; ip str; while(q--) { int type; ip type; if(type==1) { int i,j,t; ip i>>j>>t; shift(str,i,j,t); } else { int i,j; ip i>>j; string sub= str.substr(i,j-i+1); op generateSubsets(sub); nl } } return 0; }