Skip to content
Programmingoneonone
Programmingoneonone

Learn everything about programming

  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programmingoneonone
Programmingoneonone

Learn everything about programming

HackerEarth Palindromic Ciphers problem solution

YASH PAL, 31 July 2024
In this HackerEarth Palindromic Ciphers problem solution Julius Cipher is a type of cipher which relates all the lowercase alphabets to their numerical position in the alphabet, i.e., the value of a is 1, the value of b is 2, the value of z is 26, and similarly for the rest of them.
Little Chandan is obsessed with this Cipher and he keeps converting every single string he gets, to the final value one gets after the multiplication of the Julius Cipher values of a string. Arjit is fed up with Chandan’s silly activities, so he decides to at least restrict Chandan’s bad habits.
So, he asks Chandan not to touch any string which is a palindrome, otherwise, he is allowed to find the product of the Julius Cipher values of the string.
HackerEarth Palindromic Ciphers problem solution

HackerEarth Palindromic Ciphers problem solution.

x = "abcdefghijklmnopqrstuvwxyz"
y = list(x)
tc = int(raw_input())
while tc>0:
tc = tc - 1
s = raw_input()
if s==s[::-1]:
print "Palindrome"
else:
ans = 1
for i in s:
ans = ans * (y.index(i)+1)
print ans
coding problems solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes