Question
Use python language (concept of Lists and Dictionaries). Use any String manipulation built in python libraries/functions. I am a beginner in python so keep the
Use python language (concept of Lists and Dictionaries). Use any String manipulation built in python libraries/functions. I am a beginner in python so keep the codes simple. Please solve part (a), (b), (c) and (d). Use visual studio code or any other compiler.
(a)
Given two strings, split the string to character then check whether the given strings are Anagrams or not. An anagram is a word formed by rearranging the letters of another given word, for example, car and arc.
(b)
Write an efficient program to test if two given String is a rotation of each other or not, e.g. if the given String is \"XYZ\" and \"ZXY\" then your function should return true, but if the input is \"XYZ\" and \"YXZ\" then return false.
(c)
A string is said to be \"SUPER STRING\" if the number of times the character appeared in the string is equal to its ASCII value. Given the conditions that the ASCII value of A is 26 and Z is 1. Example: ZYYZ is not SUPER STRING (As Y appear 2 time and ASCII is 2 but Zs ASCII is 1 but appeared 2 time). ZYY is SUPER STRING
(d)
Write a program that takes a string as input and calculate the possible number of sub-string that are palindrome. Recall that a palindrome is a non-empty string that reads the same backward as forward. Two sub-strings are considered to be different if they have different lengths or start at different positions in the original string. For example string ABBA has possible 4 sub-string palindromes { A, B, BB, ABBA}.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started