TopcoderARCHIVE
Archive/Problems/DevuAndGoodPalindromicString
SRM · Problem 13735

DevuAndGoodPalindromicString

Problem statement, definition, constraints, and public examples.

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).

Definition

Class:
DevuAndGoodPalindromicString
Method:
isGoodPalindrome
Parameters:
String
Returns:
String
Method signature:
String isGoodPalindrome(String s)
(be sure your method is public)

Constraints

  • s will have between 1 and 50 characters, inclusive.
  • Each character of s will be a lower case English alphabet ('a'-'z').

Examples

  1. "aa"
    Returns: "good"
    String "aa" itself is a "good" palindrome.
  2. "ab"
    Returns: "not good"
    String "ab" is not "good" palindrome.
  3. "abcdcd"
    Returns: "good"
  4. "abcfb"
    Returns: "not good"
  5. "dyofbggtfhlplctmmofhgbegsqgzaecjs"
    Returns: "good"
  6. "deqmxlgoeiwqsrlyfbpgnmr"
    Returns: "not good"
← All problems