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

Pipelining, tellme the types of pipelining

tellme the types of pipelining

The elif Statement, The elif statement permits you to check multiple expres...

The elif statement permits you to check multiple expressions for truth value and execute a block of code the moment one of the conditions estimates to true. similar to the else, th

Register array, #queA register is a memory location surrounded by the CPU i...

#queA register is a memory location surrounded by the CPU itself, designed to be rapidly accessed for purposes of fast data retrieval. Processors normally hold a register array, wh

System software, System software: System software helps run the  compu...

System software: System software helps run the  computer hardware and system. It is designed to control the operations of a computer and coordinate all external devices like c

Search in problem solving-artificial intelligence, Search in Problem Solvin...

Search in Problem Solving: If Artificial intelligence I may inform the other sciences about anything, it is about problem solving and, in specific, how to find solutions to pro

Unix/linux, I need someone to help me with my Unix/Linux homework.

I need someone to help me with my Unix/Linux homework.

Explain the concept of a transition graph, Question 1 Define the concept o...

Question 1 Define the concept of equivalence relation. Give atleast two examples of equivalence relation Question 2 Prove that a graph G is connected if and only if it has a

Second generation of computers, THE SECOND GENERATION (1956-1965) ...

THE SECOND GENERATION (1956-1965) This generation of computers were characterized by:     Considerable reduction in physical size     Increased reliability

Generations of computers, Ask question #Minimum assignment on generations o...

Ask question #Minimum assignment on generations of computers 100 words accepted#

Satellite transmission, Satellite Transmission: Satellites use microwa...

Satellite Transmission: Satellites use microwave frequencies and techniques. Satellites used for message transmission (as opposed to those, which travel around the earth on st

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