Search
 
SCRIPT & CODE EXAMPLE
 

CPP

Lapindromes codechef solution in c++

///////////////////////////////////////////////////////////////////
// problem link: https://www.codechef.com/LP1TO203/problems/LAPIN 
///////////////////////////////////////////////////////////////////
#include<iostream>
#include<cmath>
#define ll long long
#include<vector>
#include<stack>
#include<climits>
#include<algorithm>
using namespace std;

void solve()
{
	string s;
	cin >> s;
	ll n = s.length();
	string s1, s2;
	for (ll i = 0; i < n/2; i++)
	{
		s1 += s[i];
		s2 += s[n - 1 - i];
	}
	sort(s1.begin(), s1.end());
	sort(s2.begin(), s2.end());
	if (s1 == s2)
		cout << "YES
";
	else
		cout << "NO
";
}

int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to srt vector array 
Cpp :: split date and time in a column in db browser 
Cpp :: c++ how to print out 
Cpp :: error when using template base class members 
Cpp :: c++ arreglo/array 
Cpp :: 771. Jewels and Stones leetcode solution in c++ 
Cpp :: hello command not printing in c++ 
Cpp :: arraylist equivalent cpp 
Cpp :: sieve of eratosthenes c++ 
Cpp :: if c++ 
Cpp :: print number with leading zeros 
Cpp :: c++ array on heap 
Cpp :: short hand if else in c++ 
Cpp :: Default code in C++ for VSCode 
Cpp :: in c++ 
Cpp :: open a url with dev c 
Cpp :: C++ mutex header 
Cpp :: why ostream cannot be constant 
C :: how to remove button decoration 
C :: allow unrelated histories 
C :: Which of the following are Cetaceans? 
C :: how to prevent user from entering char when needing int in c 
C :: How to generate a random array in c 
C :: reattach screen linux 
C :: c program 
C :: bootstrap 5 image responsive 
C :: multiplication in c 
C :: how to modulo in c without % 
C :: c memset 
C :: multiplication table in c 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =