{"id":"cb04b42c-314e-4861-bbf6-4679fc0de82d","name":"Longest Palindromic Substring","description":"1. You are given a string str.\r\n2. You are required to print the length of longest of palindromic substrings in string str.","inputFormat":"A string str","outputFormat":"A number representing the length of longest of palindromic substrings in string str.","constraints":"0 <= str.length <= 10","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"abccbc","sampleOutput":"4","questionVideo":"https://www.youtube.com/embed/WpYHNHofwjc?end=45","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":"8eccc981-b420-4757-8668-f75aba7d2b3f","name":"Longest Palindromic Substring","slug":"longest-palindromic-substring","type":1}],"next":{"id":"7c0491c0-468f-4a92-b0f8-e9ccc66d7579","name":"Russian Doll Envelopes","type":1,"slug":"russian-doll-envelopes"},"prev":{"id":"70099256-e13a-4657-8a2a-5fab8e5d7dcb","name":"Longest Palindromic Subsequences","type":1,"slug":"longest-palindromic-subsequences"}}}

Longest Palindromic Substring

1. You are given a string str. 2. You are required to print the length of longest of palindromic substrings in string str.

{"id":"cb04b42c-314e-4861-bbf6-4679fc0de82d","name":"Longest Palindromic Substring","description":"1. You are given a string str.\r\n2. You are required to print the length of longest of palindromic substrings in string str.","inputFormat":"A string str","outputFormat":"A number representing the length of longest of palindromic substrings in string str.","constraints":"0 <= str.length <= 10","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"abccbc","sampleOutput":"4","questionVideo":"https://www.youtube.com/embed/WpYHNHofwjc?end=45","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":"8eccc981-b420-4757-8668-f75aba7d2b3f","name":"Longest Palindromic Substring","slug":"longest-palindromic-substring","type":1}],"next":{"id":"7c0491c0-468f-4a92-b0f8-e9ccc66d7579","name":"Russian Doll Envelopes","type":1,"slug":"russian-doll-envelopes"},"prev":{"id":"70099256-e13a-4657-8a2a-5fab8e5d7dcb","name":"Longest Palindromic Subsequences","type":1,"slug":"longest-palindromic-subsequences"}}}
plane

Editor


Loading...

Longest Palindromic Substring

medium

1. You are given a string str. 2. You are required to print the length of longest of palindromic substrings in string str.

Constraints

0 <= str.length <= 10

Format

Input

A string str

Output

A number representing the length of longest of palindromic substrings in string str.

Example

Sample Input

abccbc

Sample Output

4

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode