Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int test_case;
- cin >> test_case;
- for(int T = 0; T < test_case; T += 1) {
- string a, b;
- cin >> a >> b;
- int i = 0;
- int j = 0;
- int n = a.size();
- int m = b.size();
- while(i < n and j < m) {
- if(i == n or j == m) {
- break;
- }
- if(a[i] == b[j]) {
- i += 1;
- j += 1;
- }
- else {
- j += 1;
- }
- }
- if(i == n) {
- cout << "DA" << endl;
- }
- else {
- cout << "NE" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment