super ascii string cost in c++, Programming Languages

Assignment Help:
Ask question #Minimum 100 A 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'''')words accepted#

Related Discussions:- super ascii string cost in c++

Program for nuclear reactor - embedded systems, Implement the "Nuclear Reac...

Implement the "Nuclear Reactor" example using the following:  An ISR triggered by a button press  A task to update the temperatures  A semaphore to communicate between the ISR and

Pascal, how do i make a bomber game using pascal on a software called lazur...

how do i make a bomber game using pascal on a software called lazuras

Abstraction hierarchy of mechanisms, Abstraction hierarchy of mechanisms ...

Abstraction hierarchy of mechanisms Given  the light-sensitive the motor and resistor,  we could  find  several  ways  of interconnecting them, using bits of ceramic and metal

Programming (problem solving), develop a pseudocode algorithm to determine ...

develop a pseudocode algorithm to determine the total amount of extra cost changed to the organizers for expenses accurednduring the workshop. the code is to be written for an unde

Risk - controls and audit tests, Internal Audit has been asked by the State...

Internal Audit has been asked by the State to review the activities of  The Commission on Workforce Development. The Commission was established several years ago by the state legis

Network management configuratio, You will create a simple network managemen...

You will create a simple network management configuration which checks that certain programs are running on your network and are performing as expected, and that certain system det

Assembly language programm , these 8 numbers (15, 20, 25, 30, 35, 40, 45, a...

these 8 numbers (15, 20, 25, 30, 35, 40, 45, and 50) with using conditional jump

Produce a hierarchy chart-a structured flowchart, Produce a hierarchy chart...

Produce a hierarchy chart, a structured flowchart, and a Pascal program (with appropriate comments) to generate the Sales Commission Report shown below. The commission for each sal

Selection structure, Name : Jaya Malathy IC No : 99011460923 Quiz 1 : 20....

Name : Jaya Malathy IC No : 99011460923 Quiz 1 : 20.5 Quiz 2 : 22.5 Quiz 3 40.5 Total marks = 83.5 Name IC No Quiz1 Quiz2 Quiz3 Grade --- ---- ---- ---- ---- ---- Jaya 990

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