Google-Developer-Student-Club-CCOEW / Competitive-Coding

7 stars 52 forks source link

Question 21 #36

Closed komalvhanmane closed 2 years ago

komalvhanmane commented 2 years ago

You are given a palindrome string P of length N consisting of only lowercase letters of the English alphabet. Find the shortest non-empty palindrome string Q such that P concatenated with Q forms a palindrome. Formally, the string PQ forms a palindrome.

Input The first line of the input gives the number of test cases, T. T test cases follow. Each test case consists of two lines. The first line of each test case contains an integer N denoting the length of the string P. The second line of each test case contains a palindrome string P of length N.

Output For each test case, output one line containing Case # x: y, where x is the test case number (starting from 1) and y is the non-empty palindrome string Q as described above.

Input 3 4 abba 4 cccc 6 cdccdc

Output: Case # 1: abba Case # 2: c Case # 3: cdc

kasturimandlik commented 2 years ago

Kasturi Mandlik Cummins College of Engineering for Women, Pune Dept: Electronics and Telecommunication I would like to work on this issue

ManasiGDeshmukh commented 2 years ago

Manasi Deshmukh CCOEW SY Computer Department can you assign this issue to me?

KanikaRaheja commented 2 years ago

Name: Kanika Raheja College: Indira Gandhi Delhi Technical University for Women(IGDTUW) Dept : Information Technology(IT) Please assign this issue to me.

komalvhanmane commented 2 years ago

@KanikaRaheja I have assigned you this issue . Work on it :)