All Tracks Algorithms Dynamic Programming 2 Dimensional Problem

Palindromic sub string Length
Tag(s):

Very-Easy

Problem
Editorial
Analytics

Given a string, find the length of the maximum length palindromic sub string .

Suppose 'l' is the length of maximum length palindromic sub string, check whether 'l' is prime number or not, if it is prime ,then print 'PRIME' else 'NOT PRIME' .

Input:

  • test cases, t
  • string, s

Output :

Desired O/p

Constraints:

String length<=10000

SAMPLE INPUT
3
aabaaz
aavsba
ghsdffssff
SAMPLE OUTPUT
PRIME
PRIME
NOT PRIME
Time Limit: 1,0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Уведомления
View All Notifications

?