`{"id":"982ff998-a79e-4355-b671-6a26e27dbc78","name":"Minimum Insertions To Make Palindrome","description":"1. You are given a string(str).\r\n2. You have to find the minimum number of characters to be inserted to convert it to a palindrome.","inputFormat":"A string","outputFormat":"Check the sample output and question video.","constraints":"1 &lt;= length of s1 &lt;= 10000","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\t\r\n\tpublic static int solution(String str) {\r\n\t\t// write your code here\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tString str = scn.next();\r\n\t\tSystem.out.println(solution(str));\r\n\t}\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"pepperatcoding","sampleOutput":"10\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"c9f7599f-03ee-4047-8f5a-d272afab2554","name":"Minimum Insertions To Make Palindrome","slug":"minimum-insertions-to-make-palindrome","type":1}],"next":{"id":"7204e434-8963-4a03-a8bb-c27698853fd9","name":"Minimum Delta In Partitions","type":1,"slug":"minimum-delta-in-partitions"},"prev":{"id":"4b26bb1d-60d1-4687-bf09-f25d7aeac509","name":"Alternating Subsequence With Maximum Sum","type":1,"slug":"alternating-subsequence-with-maximum-sum"}}}`

# Minimum Insertions To Make Palindrome

1. You are given a string(str). 2. You have to find the minimum number of characters to be inserted to convert it to a palindrome.

`{"id":"982ff998-a79e-4355-b671-6a26e27dbc78","name":"Minimum Insertions To Make Palindrome","description":"1. You are given a string(str).\r\n2. You have to find the minimum number of characters to be inserted to convert it to a palindrome.","inputFormat":"A string","outputFormat":"Check the sample output and question video.","constraints":"1 &lt;= length of s1 &lt;= 10000","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\t\r\n\tpublic static int solution(String str) {\r\n\t\t// write your code here\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tString str = scn.next();\r\n\t\tSystem.out.println(solution(str));\r\n\t}\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"pepperatcoding","sampleOutput":"10\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"c9f7599f-03ee-4047-8f5a-d272afab2554","name":"Minimum Insertions To Make Palindrome","slug":"minimum-insertions-to-make-palindrome","type":1}],"next":{"id":"7204e434-8963-4a03-a8bb-c27698853fd9","name":"Minimum Delta In Partitions","type":1,"slug":"minimum-delta-in-partitions"},"prev":{"id":"4b26bb1d-60d1-4687-bf09-f25d7aeac509","name":"Alternating Subsequence With Maximum Sum","type":1,"slug":"alternating-subsequence-with-maximum-sum"}}}`

Editor

# Minimum Insertions To Make Palindrome

easy

1. You are given a string(str). 2. You have to find the minimum number of characters to be inserted to convert it to a palindrome.

## Constraints

1 <= length of s1 <= 10000

## Format

A string

### Output

Check the sample output and question video.

## Example

Sample Input

`.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}pepperatcoding`

### Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}10 ```

Discussions

Show Discussion

Related Resources