in python language 2. Section #Prog Question 1 How to Attempt? Halindrome Given a string S, divide
Fantastic news! We've Found the answer you've been seeking!
Question:
in python language
Transcribed Image Text:
2. Section #Prog Question 1 How to Attempt? Halindrome Given a string S, divide it into two equal parts S1 and S2. S is called a halindrome if at least any one of the following condition 1. S is a palindrome and length of S>=2. 2. S1 is a halindrome. 3. S2 is a halindrome. Your task is to find and return the number of halindromes in an array F Note: In the case of an odd length string, the middle element is not present in both middle element is m, then, S1 = S [0, m-1] and S2 = S [m+1, [S]-1]. Input Specification input 1: An integer value denoting the number of strings (1<=input input 2: A string array of size input1 (2 <= length of each string <=1 Output Specification Return the number of strings which are halindromes. Example 1 Metti Online Assessment 2021-2031 2. Section #Prog Question 1 How to Attempt? Halindrome Given a string S, divide it into two equal parts S1 and S2. S is called a halindrome if at least any one of the following condition 1. S is a palindrome and length of S>=2. 2. S1 is a halindrome. 3. S2 is a halindrome. Your task is to find and return the number of halindromes in an array F Note: In the case of an odd length string, the middle element is not present in both middle element is m, then, S1 = S [0, m-1] and S2 = S [m+1, [S]-1]. Input Specification input 1: An integer value denoting the number of strings (1<=input input 2: A string array of size input1 (2 <= length of each string <=1 Output Specification Return the number of strings which are halindromes. Example 1 Metti Online Assessment 2021-2031
Expert Answer:
Answer rating: 100% (QA)
Python Program function to check the string is Palindrome or not def ... View the full answer
Related Book For
Thermodynamics An Engineering Approach
ISBN: 978-0073398174
8th edition
Authors: Yunus A. Cengel, Michael A. Boles
Posted Date:
Students also viewed these programming questions
-
Please write in Python Language to create a Program for Contact Management System. It is similar to the contact manager in cell phones. In this program, you can add, view, edit, search, and delete...
-
: Write code in the next cell to do the following: 1. Asks the user for their first, middle, and last names and stores each in a new variable. 2. Computes the length of the name not including spaces...
-
Metro Land is a country located on a 2D Plane. They are having asummer festival for everyone in the country and would like tominimize the overall cost of travel for their citizens. Costs oftravel are...
-
An inverted pyramidal tank has an equilateral triangular base measuring 3 ft. on a side and an altitude of 7 ft. DSMIT adi a. How many gallons of water can the tank hold? b. What will be the wetted...
-
Define the terms reach, frequency, and impact.
-
1. Volkswagens annual report explains that, The Volkswagen Group consists of two divisions: the Automotive Division and the Financial Services Division. The Automotive Division comprises the...
-
If grandfathering is accepted as the basis for allocating initial emission permits what is the likely impact on early action (action before trading schemes commence) being taken to reduce emissions?...
-
The capital investment committee of Touch of Eden Landscaping Company is considering two capital investments. The estimated income from operations and net cash flows from each investment are as...
-
At BCD car wash, when a customer arrives, he or she first checks in with a receptionist and then leaves the car to one of several car washers. While the customer is waiting for the car to be washed,...
-
1. What factors might have enabled JLR to raise new debt at less than half the coupon rate of interest in 2015 compared with the debt raised in 2011? 2. Compute the amount at which existing...
-
Q1) Two random variables X and Y with joint probability distribution function fxy(xy) = axy, for 0x1, 0y2 (40 points) (a) Prove that the constant a = (b) Find the two marginal function g(x), and...
-
(6 marks) Dene a procedure deep list - remove that takes two inputs: 3 test procedure and a List.As output, it produces a List that is a copy of the input List with all of the elements for which the...
-
Statistics show that entrepreneurship is a less common choice for women than men. In your opinion, when is entrepreneurship the right choice for women? If you know any women entrepreneurs, or are one...
-
List the differences among civil law, common law, and theocratic law. Explain why it is important to understand these laws, specifically how they relate to different countries and the institutions...
-
Determine the derivative using basic differentiation laws: h(m) - em - me +e+ 5-In(11m) h' (m) - sin (a)
-
Answer the following questions based on the chart on the next page. Identify your selected aircraft by case number (CC-AR6-1, CC-AR6-2, etc.). Note that there is more than one good answer for each...
-
Hi, I need help with this accounting problem, thanks inadvance.l [The following information applies to the questions displayed below.] Delph Company uses a job-order costing system and has two...
-
A woman at a point A on the shore of a circular lake with radius 2 mi wants to arrive at the point C diametrically opposite on the other side of the lake in the shortest possible A time. She can walk...
-
A 600-MW steam power plant, which is cooled by a nearby river, has a thermal efficiency of 40 percent. Determine the rate of heat transfer to the river water. Will the actual heat transfer rate be...
-
Consider two Carnot heat engines operating in series. The first engine receives heat from the reservoir at 1400 K and rejects the waste heat to another reservoir at temperature T. The second engine...
-
The pump of a water distribution system is powered by a 15-kW electric motor whose efficiency is 90 percent. The water flow rate through the pump is 50 L/s. The diameters of the inlet and outlet...
-
Explain what the following terms mean a. Accounts receivable f. Accounts payable b. Supplies g. Unearned service revenue c. Prepaid rent h. Service revenue d. Furniture i. Rent expense e. Accumulated...
-
Which columns of the accounting work sheet show unadjusted amounts? a. Trial balance b. Adjustments c. Income Statement d. Balance Sheet
-
Riley Insurance Agency reported the following items at May 31: Make Riley's closing entries, as needed, for these accounts. Sales and marketing expense Other assets Depreciation expense Long-term...
Study smarter with the SolutionInn App