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

Java virtual machine, Expertsmind.com is expert in java assignment help ...

Expertsmind.com is expert in java assignment help JAVA Virtual Machine A Java exclusive device or java virtual machine (JVM) is an exclusive device able of undertaking Jav

Write a program to read the file, Suppose you have a ?le orase of city and ...

Suppose you have a ?le orase of city and country names, like this: Cluj, Romania Debrecen, Hungary Klagenfurt, Austria Berlin, Germany Szeged, Hungary Budapest, Hungary Lintz, A

programming assignment using perl, This assignment is an individual progra...

This assignment is an individual programming assignment using Perl. It addresses objectives 3, 4, 5 and 8 as listed in the Subject Outline document. The assignment is based on them

Adding new features to a simple shell implementation, You will be working o...

You will be working on creating both a realistic project environment and on adding new features to a simple shell implementation provided in shell.tar.z. After you un-tar it, let's

String data transfer instruction in assembly language, What are the string ...

What are the string data transfer instruction in assembly language? Explain all types of string data transfer instructions with examples of each? What will be the behavior of direc

Overview of procedure-oriented programming paradigm, Procedure-oriented pro...

Procedure-oriented programming (POP):- This is a top-down programming approach, where the problem is viewed as a sequence of tasks to be done such as calculating, printing etc. A n

Solve the given initial value problem, Solve the following initial value pr...

Solve the following initial value problem y (3) - 5y'' - 22y' + 56 y= 0;       y(0) = 1;           y'(0) = -2;         y''(0) = -4 Solution : r 3 - 5r 2 - 22r + 56 = (

Introduction to c#, All programs have to be done in console application. Pr...

All programs have to be done in console application. Program 1, 2 and 3 are due on 2/11/12 Program 4, 5, and 6 are due on 2/18/12 Program 7, 8, and 9 are due on 2/25/12 Program 10

Wsdl service architecture in uml, Design the proposed implementation using ...

Design the proposed implementation using the contract first approach and object oriented approaches.  At a minimum, you must provide an overview of the services in the service arch

Language processors, explain steps of program execution in language process...

explain steps of program execution in language processors

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