IEM903-Editorial

Practice

DIFFICULTY:

MODERATE

PREREQUISITES: Data Structure, String

PROBLEM: Contest Page | CodeChef

Author: Prithwineel Paul, Sumanta Chakraborty

EXPLANATION:

a5a2a3a4a5a2a3a4a6

Output:

yes
5

Hence,

Test Cases:

1
Input:
a6a7a8a6a5a4a3a7a8a6a5a4a3a7
Output:
yes
2

2
Input:
a6a7a8a6a5a4a6a7a8a6a5a4a3a7
Output:
yes
7

3
Input:
a1a6a7a5a3a4a6a7a5a3a4a6a8
Output:
no

4
Input:
a1a6a7a5a3a1a6a7a5a3a4a6a8
Output:
yes
6

5
Input:
a1a2a3a4a5a5a4a3a2a1
Output:
no

Source Code (Python 3.6):

Click here