Question 2 of 2
Write a program that takes two strings Sl and S2 as input (one per line). The program checks if the string S1 can be created by rearranging
the characters of the string S2 and vice versa. If yes, the program should print YES, NO otherwise. The program should ignore the case
sensitivity of characters.
For example,
For the input provided as follows:
Bat
TAB
The output of the program will be
YES
Answers
Answer:
) Education helps to provide knowledge, develop a logical attitude and enhance the capability of an individual.
2) A country with educated citizens will always have people with logical thinking and views.
3) In democratic countries, education plays a crucial role in choosing the right government.
4) Education helps in the physical, social, mental and spiritual development of an individual.
5) It also enhances the social and moral values of a person and makes him more sensible, tolerant, helpful and empathic.
6) It modifies and enhances the behaviour of a person through rigorous learning and development.
7) Education helps in eradicating poverty and bringing equality in society.
8) It is a way of giving an intellectual channel to the decision-making capabilities of the citizens of a country.
9) The development in the fields of arts, science, technology etc. is only possible because of education.
10) Education prepares the children for the future so that they can contribute towards the development.
Set 4
1) Education makes a person self-reliant and independent in social, financial and intellectual a
2) In ancient India, education was for everyone, but it became available based on the caste and duties.
3) Nalanda and Taxila were the most famous educational institutions of ancient times.
4) No one can steal education, so it remains with us always and neve
5) In India, there are majorly three types of schools as Government Schools, Government Aided Private Schools and Private Schools.
6) Government of d various initiatives in the field of education like Udaan, Saksham, Pragati etc.
7) These initiatives have majorly helped to improve the status and quality of education in India.
8) The development of science and technology has also changed
9) Nowadays, there are various techniques and methods to impart education like e-learning, video-based learning etc.
10) Education has always been
Answer:
Following is code in c++
Step-by-step explanation:
include<bits/stdc++.h>
using namespace std;
string partOdd(string s)
{
string ns = "";
for(int i = 0; i < s.length(); i++)
{
if (i % 2 != 0)
ns += s[i];
}
return ns;
}
string partEven(string str)
{
string s = "";
for(int i = 0; i < str.length(); i++)
{
if (i % 2 == 0)
s += str[i];
}
return s;
}
bool canBeMadeEqual(string s1, string s2)
{
string even_s1 = partEven(s1);
string even_s2 = partEven(s2);
string odd_s1 = partOdd(s1);
string odd_s2 = partOdd(s2);
sort(even_s1.begin(), even_s1.end());
sort(even_s2.begin(), even_s2.end());
sort(odd_s1.begin(), odd_s1.end());
sort(odd_s2.begin(), odd_s2.end());
if (even_s1 == even_s2 && odd_s1 == odd_s2)
return true;
return false;
}
int main()
{
string s1 , s2;
cout << "Enter word";
getline (cin, s1);
getline (cin, s2);
if(canBeMadeEqual(s1, s2))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
#SPJ3