DCP-186: Make It Palindrome Back to All Problems

Medium Divide and Conquer > Dynamic Programming


You have a string **S** of length **L** consisting of only lowercase English letters. Find the minimum numbers of characters to add to make it a palindrome. You can add any character at any position. Input: ------ Input starts with an integer **T (1 <= T <= 100)**, denoting the number of test cases. Each case contains a string **S**. Here, **1 <= L <= 1000** Output: ------- For each case of input, print the case number and the minimum number of characters to add to make the string palindrome. Sample Input ------------ 2 abda abc Sample Output ------------- Case 1: 1 Case 2: 2 Clarification ------------- For case 1, you can make it **abdba** or **adbda** For case 2, you can make it **abcba** or **acbca** or **cabac** or **cbabc**


Problem Setter:

Feroz Ahmmed

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 5.00
C++ 5.00
C++14 5.00
C# 5.00
Go 5.00
Java 5.00
JavaScript 5.00
Objective-C 5.00
Perl 5.00
PHP 5.00
Python 5.00
Python3 5.00
Ruby 5.00
VB.Net 5.00

Problem Stats

124/355

Solve/Submission

Ranking

# User Language Timing
01 feodorv Cpp14 0.17s
02 smriad Cpp 0.20s
03 abdulmukit Cpp 0.21s
04 RandyWaterhouse Cpp 0.21s
05 Masum_ice Cpp14 0.21s
06 Robbinb1993 Cpp 0.21s
07 hmtanbir Cpp14 0.22s
08 Morass Cpp14 0.22s
09 AlaminJust Cpp14 0.23s
10 ash12 Cpp14 0.24s
11 sadia2427 Cpp14 0.24s
12 vatsalsharma376 Cpp14 0.26s
13 _Lucifer Cpp14 0.28s
14 haasib Cpp14 0.28s
15 kowser_tusher Cpp 0.36s
16 SakibAlamin Cpp14 0.37s
17 Zayed Cpp 0.42s
18 rana_cse Cpp14 0.42s
19 Sakib1061 Cpp14 0.43s
20 BlurryFace Cpp14 0.43s
21 Anubis Cpp14 0.43s
22 mahmud2690 Cpp14 0.43s
23 MsNahid Cpp14 0.44s
24 msghera Cpp14 0.50s
25 sakib_muhit Cpp14 0.50s
26 _dipu Cpp14 0.50s
27 mh755628 Cpp 0.52s
28 Ishrak Cpp14 0.53s
29 tariqiitju Cpp14 0.53s
30 Mr_adnan Cpp14 0.60s
31 DarkAssassin Cpp14 0.62s
32 codehead Cpp14 0.62s
33 Unseen Cpp14 0.63s
34 KIRIN_36 Cpp14 0.63s
35 emrul Cpp14 0.66s
36 7Mahfuz Cpp14 0.67s
37 badhansen123 Cpp14 0.68s
38 nazmulasha Cpp14 0.70s
39 kashem1993 Cpp14 0.74s
40 syedabdullah Cpp14 0.74s
41 rayhan50001 Cpp14 0.74s
42 ddevilred1 Cpp14 0.75s
43 Arpan_cse_2k14 Cpp14 0.77s
44 FLA5H Cpp14 0.77s
45 zyyxxx Cpp14 0.77s
46 gamerrishad Cpp14 0.77s
47 faisalxn Cpp14 0.77s
48 subhashis_cse Cpp14 0.77s
49 clcrr Cpp14 0.78s
50 talha629 Cpp14 0.79s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support