Strings Flashcards

1
Q

Count occurrences of anagram

A

define ll long long

//METHOD - 1 O(mn) ( METHOD -2 BELOW)
#include 
using namespace std;
int main() {
	ll t;
	cin>>t;
	while(t--)
	{
	    ll count=0,i;
	    string s,c;
	    cin>>s>>c;
	    sort(c.begin(),c.end());
	    for(i=0;i
using namespace std;
#define ll long long
#define MAX 256
bool compare(ll a[],ll b[])
{
    for(ll i=0;i>t;
	while(t--)
	{
	    ll count=0,i;
	    string s,c;
	    cin>>s>>c;
	    ll m,n,countp[MAX]={0},countw[MAX]={0};
	    m = c.length();
	    n = s.length();
	    for(i=0;i
How well did you know this?
1
Not at all
2
3
4
5
Perfectly