45 batch students have recently completed their C Programming course. They are very much interested to start Competitive Programming. They went to their teacher Mr. Tahmid Rahman for workshop. But Mr. Tahmid Rahman is already very busy with scolding 36-44 batch. And he doesn’t have any time remaining to take workshop for them. But being a past acm programmer, he never ignores nor rejects the request of programmers. So he has given them a task to complete. If they can solve the problem before other batches, he will manage time to take extra workshops for them.
For this problem, you will just take two strings as Input. You need to find out in which positions do the characters in first string match with the characters in second string and should also find in which positions do the characters in second string match with the characters in first string.
If a character in one string is matched in more than one positions in second string, then print the position which is smaller. If there is no match then print -1 for that specific character. The comparison should be Case Insensitive. There should be a full stop (.) at the end of the output.
Input will contain two strings in two separate lines. Number of characters in each string will be <= 1000. There will be no empty strings in input.
Print two separate lines of output according to the problem description.
Login to submit
-String -Brute Force / Implementation