You and your friend are at mobile exhibition held in your city . There are 26 companies presenting their mobiles at different stalls. Each company will be determined using a single letter using the alphabets from a to z. There might be more than one stall for some companies present at any positions. You have betted on the sequence of the stalls with your friend. The sequence of the stalls represents the stalls of companies that you are expecting to be matched with sequence of the stalls in exhibition. If you win the bet then your friend will pay for only one product that you want to buy in exhibition.
You will win the bet if the sequence of some(or possibly all) of
the stalls in the exhibition matches the sequence that you have mentioned in
your bet. If there are extra stalls in the exhibition than the stalls stated in
your bet, then they can be ignored.
You will be given two strings stalls and bet. You need to determine
whether you win or lose the bet. If you win “Won” must be printed if you lose
the bet print “Lost”.
Example1:
Input:
abchede
abde
Output:
Won
Explanation:
The stalls present at indexes 0,1,5,6 together form the sequence(abde) in the bet. Hence the output is Won.
Example2:
Input:
Ueoghe
Ego
Output:
Lost
Explanation:
As the sequence ego is not present in stalls the output is Lost
0 Comments
Post a Comment