Connection Status:
Competition Arena > DevuAndGoodPalindromicString
Rookie SRM 10 · 2022-02-07 · by praveen123 · Brute Force, String Manipulation
Class Name: DevuAndGoodPalindromicString
Return Type: String
Method Name: isGoodPalindrome
Arg Types: (string)
Problem Statement

Problem Statement

Devu calls a string s "good palindromic" string if it contains a palindromic subtring of size greater than one.

Given a string s, Devu wants to know whether the string is a "good palindromic" substring or not. Return "good" or "not good" (without quotes).

Constraints

  • s will have between 1 and 50 characters, inclusive.
  • Each character of s will be a lower case English alphabet ('a'-'z').
Examples
0)
"aa"
Returns: "good"

String "aa" itself is a "good" palindrome.

1)
"ab"
Returns: "not good"

String "ab" is not "good" palindrome.

2)
"abcdcd"
Returns: "good"
3)
"abcfb"
Returns: "not good"
4)
"dyofbggtfhlplctmmofhgbegsqgzaecjs"
Returns: "good"

Submissions are judged against all 100 archived test cases, of which 5 are shown here. Case numbers match the judge’s.

Coding Area

Language: C++17 · define a public class DevuAndGoodPalindromicString with a public method string isGoodPalindrome(string s) · 100 test cases · 2 s / 256 MB per case

Submitting as anonymous