Ray likes puzzles. One day, he challenged Ansh with a puzzle to find a string that is the same when read forwards and backwards. Write an algorithm to find the sub-string from the given string that is the same when read forwards and backwards. Input The input consists of a string- inputStr representing the given string for the puzzle. Output From the given string, print a sub-string which is the same when read forwards and backwards.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
Question
Ray likes puzzles. One day, he challenged Ansh
with a puzzle to find a string that is the same
when read forwards and backwards.
Write an algorithm to find the sub-string from
the given string that is the same when read
forwards and backwards.
Input
The input consists of a string- inputStr
representing the given string for the puzzle.
Output
From the given string, print a sub-string which
is the same when read forwards and
backwards.
Transcribed Image Text:Ray likes puzzles. One day, he challenged Ansh with a puzzle to find a string that is the same when read forwards and backwards. Write an algorithm to find the sub-string from the given string that is the same when read forwards and backwards. Input The input consists of a string- inputStr representing the given string for the puzzle. Output From the given string, print a sub-string which is the same when read forwards and backwards.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning