A palindrome is a string that reads the same forward and backward. a substring is a contiguous subset of characters in a string. Given a string s how many distinct substrings of s are palindromes

Answers

Answer 1

Answer:

Here is the Python program to compute how many distinct substrings of a string s are palindromes:

def AllPalindromes(s, l, h, sub):  #function that finds all the palindromes

while l >= 0 and h < len(s) and s[l] == s[h]:  #the loop iterates and reads the s until s[l.h] is a palindrome

 sub.add(s[l: h + 1])  #adds the palindromes to sub

 l = l - 1  #decrements the count of l by 1

 h = h + 1 #increments the count of h by 1

def DistinctPalindromes(s):  #function to find all distinct palindromic substrings of s and also their number

substr = set()  #stores all distinct substrings of s which are palindromes

for i in range(len(s)):  #iterates through s

 AllPalindromes(s, i, i,substr) # find all  palindromes with odd length and with s[i] as mid point

 AllPalindromes(s, i, i + 1, substr) # find all  palindromes with even length and with s[i] as mid point

print("palindromic substrings are",substr, '\n',end='')  # display all distinct palindromic substrings

print(len(substr),"distinct substrings of",s,"are palindromes") # display the number of distinct palindromic substrings

print("Enter a string:")  #prompts user to enter a string

s = input()  #accepts input from user

DistinctPalindromes(s)  #calls DistinctPalindromes method by passing input string to it in order to compute the

Explanation:

The program is well explained in the comments attached with each statement of the code. The function AllPalindromes finds all the palindromes of string s. while loop iterates and reads the string forward and backward to find same i.e. palindrome. Here h and l represents high and low part of the string s. They can also be called as forward and backward pointers to the s characters. The while condition also checks the characters at s[l] position in the string s is equal to the character at s[h].  add() method is used to push all palindromes into the set  sub. The function DistinctPalindromes is used to find all the distinct substrings of s that are palindromes. The loop iterates through characters of string s and calls AllPalindromes method to find all palindromes with odd and even length. It then prints the distinct palindromic substrings . For examples s = "aabaa" then the palindromic substrings are {'aabaa', 'b', 'aba', 'a', 'aa'}  and the number of distinct substrings of aabaa that are palindromes is 5. The program along with its output is attached in a screenshot.

A Palindrome Is A String That Reads The Same Forward And Backward. A Substring Is A Contiguous Subset

Related Questions

______are unplanned responses to risk events used when project teams do not have contingency plan in place.A) Workarounds.
B) Fallback plans.
C) Contingency plans.
D) Triggers.

Answers

Answer:

B) Fallback plans.  

Explanation:

Fallback plan: The term "fallback plan" is described as a backup plan that is being related to the contingency plan. Thus, it comes into consideration when the contingency plan is being failed to get implemented ans similarly when the fallback plan failed to work then the contingency plan comes into consideration.

In the question above, the given statement represents the fallback plans.

Comments are used to write pseudocode outlines. How do you indicate that a line is a comment? You start the line with a _________

Answers

Answer:

#

Explanation:

A more common way to plan a program is with pseudocode, an outline composed of comments. Comments are indicated by a pound sign (#) at the beginning of the line.

Depending on the programming language, there are several ways we can comments our statements or codes that are not needed in our programmes

In Kotlin and Java Languages we can us the double slash "//" symbol to express single line comment

Example

//This is a comments

We can also us the "/***/" to express multi line comments

Example

/**This is a comment

also*/

Hence we have the

Inline Comments Multiline Comments

For more information on comments in programming language kindly visit

https://brainly.com/question/15068446

___________ allows users to share and collaborate the data relevant to groups, individuals or organizations. qlikview

Answers

Answer:

Business Intelligence

Explanation:

Business Intelligence refers to all the methods and technologies applied towards obtaining, computing, and analyzing business data which would serve the purpose of informing better decision making. Business Intelligence analyzes huge amounts of business data and breaks them down for easy comprehension. They help to provide insight into the current and past market situations that would help managers in making better predictions.  

Some of such decisions could be the effect of breaking into new markets or increasing the prices of products and services. The data obtained during business intelligence should come from the market where the products are sold as well as data compiled by the organization, so as to provide holistic information.

Why computer is known as data processing system?

Answers

Computer is known as data processing system because it changes raw data that is not in useful form such as tables, figures, etc into processed data known as information that is useful. Processing includes manipulating, storing, accessing, and transmitting.

How should you handle cyberbullies?

Answers

Answer:

insult those son of a bishes backk

i would ✨punch them ✨

Describe and define each of the following tkinter widgets:
a) Label
b) Entry
c) Button
d) Frame

Answers

Answer:

Tkinter in Python comes with a lot of good widgets. Widgets are standard graphical user interface (GUI) elements, like different kinds of buttons and menus.   Ttk comes with 17 widgets, eleven of which already existed in tkinter:

Button Checkbutton Entry Frame Label LabelFrame Menubutton PanedWindow Radiobutton Scale and Scrollbar

The other six are new: Combobox, Notebook, Progressbar, Separator, Sizegrip and Treeview. And all them are subclasses of Widget.

Explanation:

The Label widget is a standard Tkinter widget used to display a text or image on the screen. The label can only display text in a single font, but the text may span more than one line. In addition, one of the characters can be underlined, for example to mark a keyboard shortcut.Entry widgets are the basic widgets of Tkinter used to get input, i.e. text strings, from the user of an application. This widget allows the user to enter a single line of text. If the user enters a string, which is longer than the available display space of the widget, the content will be scrolled.The Button widget is a standard Tkinter widget used to implement various kinds of buttons. Buttons can contain text or images, and you can associate a Python function or method with each button. When the button is pressed, Tkinter automatically calls that function or method.A frame is rectangular region on the screen. The frame widget is mainly used as a geometry master for other widgets, or to provide padding between other widgets.

The definition of widgets is given:

a) Label - It is a common Tkinter widget that displays text or an image on the screen.

b) Entry - They are the fundamental Tkinter widgets used to collect input, i.e. text strings, from an application's user.

c) Button - it is a Tkinter standard that is used to implement various types of buttons.

d) Frame - it is a rectangle on the screen. The frame widget is primarily used as a geometry master for other widgets or as padding between other widgets.

What are Tkinter widgets?

Tkinter in Python includes a plethora of useful widgets. Widgets are graphical user interface (GUI) elements that include various types of buttons and menus.

The label can only display text in one font, but the text can span multiple lines. Furthermore, one of the characters can be highlighted, for example, to indicate a keyboard shortcut.

Therefore, the definitions of the widgets are given above.

To learn more about Tkinter widgets, refer to the below link:

https://brainly.com/question/17438804

#SPJ2

When working in an application and the user saves their work, sometimes at the bottom of the window, a progress bar will indicate show the progress of the save operation. This is an example of what?​ a. ​ Active discovery b. ​ Provide closure on a dialogue or action. c. ​ Saving the user’s work d. ​ Affordance

Answers

The correct answer is B provide closure

The instructions tha tell the computer how to carry out the processing tasks are refered to as........

Answers

Answer:

Code

Explanation:

Code are basically instructions in the computers language to tell the computer “what to do.” If you want to, say, open and edit a file, you’d tell the computer to do that by:

Opening the file

Finding where to edit

Adding the line of your choice

Hope this helped!

does anyone know about the progressive era?

Answers

Answer: The Progressive Era was a period of widespread social activism and political reform across the United States that spanned the 1890s to the 1920s.

Explanation:

I have heard of it but not completely sure

What is the key function provided by a network

Answers

Answer:

A  key Network Function (NF) of SBA is the Network Repository Function (NRF), which provides NF service registration and discovery, enabling NFs to identify appropriate services in one another.

hope this helps

Explanation:

Which are examples of normative goals

Answers

Answer:

Goal-based decision making is goal generation together with goal-based planning

This decomposition of decision making in goal generation and planning raises several

questions, such as:

– How to represent beliefs? How to represent obligations? In this paper we represent

beliefs and obligations by rules, following the dominant tradition in deontic logic

(see e.g. [26,27]).

– How to develop a normative decision theory based on belief and obligation rules?

In this paper we introduce a qualitative decision theory, based on belief (B) and

obligation (O) rules.

What is an efficiency target? Give an example of setting an efficiency target

Answers

Answer:

Goals help provide our everyday lives with structure, and operate similarly at the institutional level, offering organizations a low cost method of encouraging motivation, communication and accountability. In short, goals help organizations to achieve a variety of ends—including the reduction of energy waste.

Energy efficiency improvement goals, also known as energy efficiency targets, are intended reductions in energy over a specified time frame that have been defined in a SMART manner. Targets are useful because they can encourage decision makers to improve the use of energy in their communities and operations. Moreover, energy efficiency targets can have short or long term timeframes and can be implemented on various scales, ranging from the national level down to individual buildings. Cities should explore both mandatory public sector targets and voluntary private sector targets to forge energy-efficient communities.

The best way to share criticism is to ______. a. write it in the break room b. talk it about with all your coworkers c. talk about it privately d. discuss it at meetings

Answers

Answer:

C.

Explanation:

Answer:

The correct answer is C. hope this helps

Explanation:

I also got a %100 one the test so its right.

Which quality of service (QoS) mechanism provided by the network does real-time transport protocol (RTP) rely on to guarantee a certain QoS for the data streams it carries

Answers

Answer:

The real-time transport protocol (RTP) carries the audio and video data for streaming and uses the real-time control Protocol to analyse the quality of service and synchronisation. The RTP uses the user datagram protocol ( UDP) to transmit media data and has a recommended Voice over IP configuration.

Explanation:

RTP is a network protocol used alongside RTCP to transmit video and audio file over IP networks and to synchronise and maintain its quality of service.

If two classes combine some private data members and provides public member functions to access and manipulate those data members. Where is abstraction used?a. Using private access specifier for data membersb. Using class concept with both data members and member functionsc. Using public member functions to access and manipulate the data membersd. Data is not sufficient to decide what is being used

Answers

Answer:

c. Using public member functions to access and manipulate the data members

Explanation:

In object oriented programming, abstraction is used in order to lessen the complexity and hiding non essential details about how a program is actually working in the background. In order to achieve abstraction, classes are defined in such a way that the data members are hidden and the member functions form public interface. The public member functions here are used to access and manipulate these hidden or private data members. So the use of public member functions shows the abstraction here. These members functions are public so they can be directly accessed and the hidden or private data members can be accessed indirectly with the help of these member functions. So internal details of the classes and its data members are hidden from the outside world. Thus abstraction used here ensures security of data members of two classes and protects them from any accidental alterations by other parts of program.

if someone has become very attached to their device and feels anxious if they cannot connect to the internet what are they experiencing

Answers

Answer:

anxiety or depression

Explanation:

Because if you like an device if you get get it you get sad and sad and sadder

Why is the unallocated space of a Windows system so important to a forensic investigator?

Answers

Answer:

Unallocated space can potentially contain all of these types of files and evidence, either completely or partially as fragments, which can remain untouched for long periods of time, even years after the deletion or activity. This data and evidence cannot be viewed by an ordinary computer user, but can be recovered and examined with specialized forensic software and the expertise of a forensic investigator .

Hope this helps :))

Which system changeover method would you recommend for an air traffic control system upgrade? Explain your answer.

Answers

Answer:

The definition regarding the given concern is outlined in the following part on the clarification.

Explanation:

As a consequence of technological change, organizations continue to update their software management systems. In implementing a traffic support system update, many methods of changeover growing are considered. The Pilot Changeover procedure is ideally among the different procedures of exchange. The process includes testing the device across a minimal scale at an approved site until the commitment to start it in their organization becomes undertaken.After satisfactory testing, the immediate changeover method becomes required to start the device. This approach is also advantageous as it helps the organization to operate the current model parallel towards the previous one although at much significantly cheaper cost than the simultaneous switching system, rendering it more cost-effective. This happens although the device becomes less expensive, this is fewer expensive because around a similar moment it would not encourage the commercial procedures to generate any disruption.

In Microsoft Excel, which statement is not a recommended guideline for designing and creating an Excel table? Avoid naming two fields with the same name. Ensure no blank columns separate data columns within the table. Leave one blank row between records in the table. Include field names on the first row of the table.

Answers

Answer:

Leave one blank row between records in the table.

Explanation:

In Microsoft Excel application, there are recommended guidelines for designing and creating an Excel table, to carry out some operations, some of which are:

1. Do not use two fields with the same name.

2. Users should make sure there are no blank columns separate data columns within the table.

3. Incorporate field names on the first row of the table.

Hence, in this case, the statement that is not a statement is not a recommended guideline for designing, and creating an Excel table is "Leave one blank row between records in the table."

Research is much concerned with proper fact finding, analysis and evaluation.” Do you agree with this statement? Give reasons in support of your answer.​

Answers

Answer:

Yes, I agree.

Explanation:

Research is basically trying to find out new ways of doing things or challenging an already established claim or theory, with the aim of disproving or improving on it.

So, research is much concerned with proper fact-finding, which would ensure that the results and samples are accurate, analysis and evaluation which would make sure that the new data gotten is properly investigated.

I agree that Research is much concerned with proper fact finding, analysis because research increases the stock of knowledge and requires different analysis and facts base on past research.

What is Research?

Research can be regarded as reactive and systematic work which is been carried out to bring about improvement in knowledge of the reseacher.

In research, findings needs to be done, it could requires experiments and field work, evaluation of the results is also needed to compare with past results of the past scholars.

Learn more about Research at:

https://brainly.com/question/968894

What is the value of the variable index after the Python code below is executed? word = 'bAnana' index = word.find('a')

Answers

Answer:

index = 3

Explanation:

the find() function finds the first instance of a letter or word.

'b' = 0

'A' = 1

'n' = 2

'a' = 3

'n' = 4

'a' = 5

the first instance of 'a' in  "bAnana" is found at index location 3 computer scientist start counting from zero.

The index value of "a" in python code is "3".

Program Explanation:

In the given code, a variable "word" is declared that initializes with a string value that is "bAnana".In the next line, an "index" variable is defined that uses a "word" variable with the find method that prints the index value of "a".Using the print method, that prints the "index" value.

Program:

word = 'bAnana' #defining a variable word that initializes with string value

index = word.find('a')#defining a variable index that calls the find method to print index value of a

print(index)#print index value

Output:

Please find the attached file.

Reason for the output:

Since the array of indexing starts with 0 so, the index value of "a" is "3".  

Learn more:

brainly.com/question/13437928

Timeliness is an important goal of any access control monitoring system.
A. True
B. False

Answers

The answer for this question is true

In which of the following careers must one learn and use programming languages?

Answers

Answer: any job that has programming in it

Discuss a particular type of Malware and how has it been used in "todays news" and the respective impact on cyber security. Add to your discussion ways the Malware could have been detected and potentially avoided.

Answers

Answer:

Trojan Malware

Explanation:

Trojan horse malware is considered to be one of the most famous computer malware or virus right now. This type of malware is used to fool or trick a user into downloading some malicious software or any file. These attacks are then done by the cyber criminal who can access your system for can get your private credentials.

They send an fake email or a link and by clicking on this fake link, the cyber criminal get access to our computer from where he can access our confidential credentials.

Such a type of cyber attack can be controlled if the employees of the organisation are been educated regularly about the potential threats of these type of malware. Care should be taken not to download file from any un-trusted websites or emails.

Write a program that asks the user for three names, then prints the names in reverse order.
Please enter three names:
Zoey
Zeb
Zena
Zena
Zeb
Zoey

Answers

Answer:

The program written in C++ is as follows'

#include<iostream>

using namespace std;

int main()

{

string names[3];

cout<<"Please enter three names: "<<endl;

for (int i = 0; i< 3;i++)

{

cin>>names[i];

}

for (int i = 2; i>= 0;i--)

{

cout<<names[i]<<endl;

}

return 0;

}

Explanation:

This line declares an array for 3 elements

string names[3];

This line prompts user for three names

cout<<"Please enter three names: "<<endl;

This following iteration lets user input the three names

for (int i = 0; i< 3;i++)  {  cin>>names[i];  }

The following iteration prints the three names in reverse order

for (int i = 2; i>= 0;i--)  {  cout<<names[i]<<endl;  }

If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’re E-business. Do you think that cookies are stored and maintain such information on the server-side and hackers can't steal user's information from these cookies easily? Do you agree with the above statement? Please give short comments in favor of or against the statement.

Answers

Answer:

cookies are stored on client side.

A hacker would need access to your computer, either by physically reading the cookie data or by means of cross-site scripting.

Other than that, cookies should not contain passwords or credit card numbers, just things like preferences or session identifiers.

_______ can be used to prevent busy waiting when implementing a semaphore.
A) Spinlocks
B) Waiting queues.
C) Mutex lock.
D) Allowing the wait

Answers

Answer:

b) waiting queues

Explanation:

how many bits long is a autonomous system number?

Answers

Answer:

There are two different formats to represent ASNs: 2-byte and 4-byte. A 2-byte ASN is a 16-bit number. This format provides for 65,536 ASNs (0 to 65535).

Explanation:

Write a program that prompts users to pick either a seat or a price. Mark sold seats by changing the price to 0. Use overloaded methods to implement seat allocation: When a user specifies a seat (row, column), make sure it is available. When a user specifies a price, find any seat with that price. Write appropriate responses to the user if the seat is already taken, if their seat is available, or the seat number of the assigned seat if they just specified a price, etc.
A theater seating chart is implemented as a two-dimensional array of ticket prices, like this:_______.
10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10
10 10 20 20 20 20 20 20 10 10
10 10 20 20 20 20 20 20 10 10
10 10 20 20 20 20 20 20 10 10
20 20 30 30 40 40 30 30 20 20
20 30 30 40 50 50 40 30 30 20
30 40 50 50 50 50 50 50 40 30

Answers

Answer:

Answer is given in the attached document.

Explanation:

Explanation is given in the attached document.

Answer:

i do not know

Explanation:

In no less than two paragraphs, explain the risks and compliance requirements of moving data and services into the cloud.

Answers

Answer:

Compliance requirements of moving data and services into the cloud:

In other to use cloud services, one has to comply or follow the rules of the service providers, the country of the location where these services are provided. All these are necessary for the safety of the data stored in the cloud.

Some countries, regions, often set up rules guarding usage and storing data in the cloud. So it is very important to be aware of this. For instance, some countries enforce data localization laws which make data of its citizen stored in the servers of the country. Here, the country has full protection over the data hosted.

There are also data sovereignty laws that give the country hosting the data a sort of authority to exercise in accordance with the law binding cloud data hosting in their region. This gives the country easy access to information in case of any legal means.

So, when choosing a cloud application, it’s important for an organization to select an application that will aid in cloud compliance and improve your security posture, not create more risk.

It is very important to first know which law is applicable to the country one is residing so as to comply with cloud usage to avoid fines and legal cases.

Risks of moving data and services into the cloud

It is good before using cloud services to know who could possibly have access to the data, if it is safe, how long could data be stored.

If there are unauthorized use of cloud services, the organization providing the service might not be aware of the safety of the hosted data which eventually decreases an organization's visibility and control of its network and data.

Data stored in the cloud could become incomplete, stolen, lost.

The client might not be able to control who else has access to the stored data.

Moving data and services into the cloud could become unattractive again as organizations could lose clients and revenue if clients' trust no longer exists.

Other Questions
How do you think plant cells differ from animal cells At a restaurant, two salads, two sandwiches, and one drink cost $23. Three salads, one sandwich, and three drinks cost $24.50. A salad costs twice as much as a drink. How much does each item cost? how freedom of choice can affect the availability of products and services for consumers. And explain how it can also affect the profit a business might make on the products and services it sells. hich of the following is associated with these names deserts such as the Sahara or the Arabian Desert?Group of answer choicessubpolar lows The Coastal Terrace contains which physical feature?hillspine forestsartificial lakessalt marshes 1. The subsets of the real numbers can be represented in a Venn diagram as shown. To which subsets of real numbers does 12 belong? A) Integers and Whole Numbers only B) Rational Numbers, Integers, and Whole Numbers C) Rational Numbers and Integers only D) Irrational Numbers, Integers, and Whole Numbers 2. Which statement BEST describes the relationship between whole numbers and natural numbers shown in the diagram? A) The diagram shows that whole numbers are a subset of natural numbers, because all whole numbers are natural numbers. B) The diagram shows that natural numbers are a subset of whole numbers, because all natural numbers are whole numbers. C) The diagram shows that whole numbers are a subset of natural numbers, because some whole numbers are not natural numbers. D) The diagram shows that natural numbers are a subset of whole numbers, because all whole numbers and natural numbers have no numbers in common. Consider the sequence "Betsy wanted to bring Jacob a present. She shook her piggy bank." Most people, after hearing this sequence, believe Betsy was checking her piggy bank to see if she had money to spend on the gift. This inference about Betsy's goals depends on the fact that:______a. Our previous knowledge fills in background information whenever we're understanding an event or conversation.b. Readers are likely to know someone named Jacob.c. English, unlike other languages, requires speakers to mention all of the people involved in an event.d. The individual sentences are short. Thanks for the help, question below :) Plz help idk which one it is how to do this question plz answer me step by step plzz Generally, State A may exercise "long arm" jurisdiction over a defendant located in State B if the defendant:________. a. once resided in State A. b. uses a product produced in State A. c. made a contract in State A. d. has relatives in State A. What happens if you rub a balloon against wool and put it against water dripping from a cup what would most likely cause the future accelaration of the expansion of the univers Dinosaur death when ill give you 50 pionts help please idk how to do this Find the length of the hypotenuse of QPO What is the role of montmorency in the chapter 'packing'? In cbse class 9 Which statement is true of employee empowerment? A) Managers should ensure that employees are not linked to resources outside the organization, such as customers. B) Jobs must be designed to give employees the necessary latitude for making a variety of decisions. C) Employee empowerment shifts the recruiting focus away from cognitive and interpersonal skills toward general technical skills. D) Employee empowerment prevents holding employees accountable for the products and services they developed. E) Proper training must be provided only to supervisors so that they can exert their wider authority. I really need help with this please Keshthe day ofrehasesThere once lived a king with three daughters. One day, he calledhis three daughters and asked them how much they love him.The first daughter said that she loved him more than all the goldand diamonds in the world. He asked his second daughter and shesaid that she loved him more than the sunlight and water. The kingwas happy with both his daughters' replies.The king then asked his youngest daughter. She said, My dearfather. I love you as much as people love salt."The king was shocked, "Salt! That's a condiment used in food!"He was very angry. "I think you don't love me at all. I will banish youfrom this kingdom." The princess was very sad and left the castle.After walking for several hours, she came to another kingdom towork as a cook. After cooking a few meals, everyone in the castlecame to know of her excellent cooking skills.One day, the king and queen of the kingdom planned a weddingfor their son. They made the princess the head cook and asked herto prepare a delicious wedding dinner for several special guests. Theprincess knew that her father would be one of the special guests.When it was time to serve the food, the princess prepared a specialtray for her father and asked the waiter to give it to him.Royal families loved the dishes and praised the cook's skills.However, the princess' father said, I don't taste anything at all. Theprincess approached her father."Father, you banished me because I said that I love you as muchas people love salt. I did not put any salt in your food. Do you seehow people love their food when it has enough salt? The king wasashamed and realised that his youngest daughter loved him veryrkshop. Givedo you thinkunderzuronte