新人求加米!加米不会扣米!!!还有plz帮忙按赞
1, Ray likes puzzles. One day, he challenged Ansh with a puzzle to find a string that is the same when read forwards and backwards.
Write an algorithm to find the sub-string from the given string that is the same when read forwards and backwards.
Input
The input consists of a string- inputstr, representing the given string for the puzzle.
Output
From the given string, print a sub-string which is the same when read forwards and backwards.
Note
If there are multiple sub-strings of equal length, choose the lexicographically smallest one.
If there are multiple sub-strings of different length, choose the one with maximum length.
If there is no sub-string that is the same when read forwards and backwards print "Non您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 使用VIP即刻解锁阅读权限或查看其他获取积分的方式 游客,您好! 本帖隐藏的内容需要积分高于 188 才可浏览 您当前积分为 0。 VIP即刻解锁阅读权限 或 查看其他获取积分的方式 is "ABC", and no sub-string is present which is same when read forward and backward.
So, the output is "None".
2. 第二个问题有一个test case没有通过,有人能告诉我如何修复它吗?
3.
新人求加米!加米不会扣米!!!还有plz帮忙按赞 |