c++, Basic Computer Science

Assignment Help:
Ask question #MiniA string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''''a''''-''''z'''') and the ascii values will starts from 1 (i.e ascii value of ''''a'''' is 1 and ''''z'''' is 26). Now given a string S, you can perform operations, namely, add, delete and replace of any character present in the string. Every operation will consists of following costs

add = 2 unit
replace = 1 unit
delete = 3 unit

Your task is to convert the string to super ascii with the minimum cost. While converting the string to super ascii, the final string should contain the same characters as in the input string.

Input Format:

First line starts with T i.e. number of test cases, and then T lines will follow each containing a string "S".

Output Format:

Print the minimum cost of conversion for each string to a Super Ascii string.

Constraints:
1<=T<=100

1<=|S|<=300, S will contains only lower case alphabets (''''a''''-''''z'''')mum 100 words accepted#

Related Discussions:- c++

Analogue and digital signals, Analogue and digital signals: Analogue (c...

Analogue and digital signals: Analogue (continuous) information is made available in virtually all aircraft equipment.  Figure 1 shows the analogue signal created by a variable

Project of interactive powerpoint in human computer , Hi There, can you h...

Hi There, can you help me with my small project please, i have sent it yesterday and you dont replay. can you please ethir lem me know you can do it or no Regrads Meshari

Explain popular way commonly used to evaluate interfaces, Question: Usi...

Question: Using a questionnaire is a popular way commonly used to evaluate interfaces. (a) Describe advantages of using questionnaires as a means to evaluate interfaces.

Graphs, Find the corresponding matrix of the digraph above

Find the corresponding matrix of the digraph above

Memory unit of computer, Memory unit of computer: The Memory  unit is ...

Memory unit of computer: The Memory  unit is an important component of a computer where all the data and information are stored in the form  of binary digits (combination of 0

Data transmission, DATA TRANSMISSION: When we talk on the telephone we...

DATA TRANSMISSION: When we talk on the telephone we generally transmit a message to someone else. The message is made up of words that we speak into the telephone instrument.

Flowcharts, what is a dry running of flow chart?

what is a dry running of flow chart?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd