There are two players $A$, $B$ playing a game. Player $A$ has a string $s$ with him, and player $B$ has string $t$ with him. Both $s$ and $t$ consist only of lower case English letters and are of equal length. $A$ makes the first move, then $B$, then $A$, and so on alternatively. Before the start of the game, the players know the content of both the strings $s$ and $t$.
These players are building one other string $w$ during the game. Initially, the string $w$ is empty. In each move, a player removes any one character from their respective string and adds this character anywhere (at any position) in the string $w$. If at any stage of the game, the string $w$ is of length greater than $1$ and is a palindrome, then the player who made the last move wins.
If even after the game finishes (ie. when both $s$ and $t$ have become empty strings), no one is able to make the string w a palindrome, then player $B$ wins.
My Strategy
If any character ($a-z$) is having a frequency greater than $1$ in string $s$ and it's not present in $t$ so $A$ will win other wise $B$.
Is my approach is correct ? Or is there any other way for $A$ to win ?
I am not sure if i am right but this is my strategy:
If lets assume the characters in string s as a set A and characters in string t as a set B.
1.If B is a subset of A then A will win
Eg: aabbe ab
A ={a,b,e} B={a,b}
Player A will use e at first and then B is forced to use one of characters that A has so A can match it and win.
2.If A is a subset of B then B will win
Eg:aabb aabbe
This is pretty obvious because whatever A uses B matches it and wins the game
3.If A and B are equal then B will win Eg: aabbcc aabbc
Whatever A uses is matched by B and hence B wins.
4.If A has 2 or more of the same characters that B doesn't have then A will win.
Eg:aabbc cbbe
A will use a at first.
Since B doesn't have a it will try to use one of the other characters and A will match again to form a palindrome.
5.If A and B are not subsets of each other,then B wins: s=aabcdef t=abcdgh
A={a,b,c,d,e,f} t={a,b,c,d,g,h}
Obviously A will try to use a character that B doesn't have(e or f),B will also use a character that A doesn't have(g or h).I think in the end B will try to make sure that A doesn't form a palindrome and there by winning.
Not sure it is right tho.