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++

Exception Handling in c++, Exception handling Exception handling is a mech...

Exception handling Exception handling is a mechanism that separates code that detects and handles exceptional circumstances from the rest of your program. Note that an exceptional

Operating systems, I do have an assignment in operating systems programming...

I do have an assignment in operating systems programming ... how can i attach my file?

Program to change date format, Write a program that accepts a date from the...

Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the name of the month. Enter a date (mm/d

For loops, How do you print triangles using for loops and if statement

How do you print triangles using for loops and if statements

Program to explore page replacement algorithms, Objective: The purpose of ...

Objective: The purpose of this programming project is to explore page replacement algorithms. This can be accomplished by developing a simple simulator that implements various pag

Pros and cons of Assembly language, What are the main pros and cons of asse...

What are the main pros and cons of assembly programming language?

Python, interference of waves

interference of waves

Assembly, Write an assembly program that computes Fibonacci numbers 2-5. a....

Write an assembly program that computes Fibonacci numbers 2-5. a. Assume Fib(0)=0 and Fib(1)=1. b. Store Fib(2) in EAX, Fib(3) in EBX, Fib(4) in ECX and Fib(5) in EDX. c. Use a LOO

Microprocessor, what is a microprocessor? types of microprocessors? advanta...

what is a microprocessor? types of microprocessors? advantages disadvantages

Fileless document and encryption(stegnography), code for using tree view co...

code for using tree view control and fill it with database

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