Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Subsequence
Description Given a string _{1}s_{u}_{2}...s where 1 ≤ _{um}u_{1} < u_{2} < ... < u ≤ _{m}n and s is the _{i}ith character of s. Your task is to write a program that, given two strings s1 and s2, checks whether either s2 or its reverse is a subsequence of s1 or not.Input The first line of input contains an integer Output For each test case, your program must output "YES", in a single line, if either Sample Input 5 arash aah arash hsr kick kkc A a a12340b b31 Sample Output YES YES NO NO YES Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator