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

Microprocessors, what is the role of microprocessors in IT? how they are us...

what is the role of microprocessors in IT? how they are used in medical field? how they are used in our real lifes? how they are used in latest technology?

Explain the effects of a lack of communication, Question 1 Explain the dif...

Question 1 Explain the different categories of Software applications Question 2 Write a note on Data Dictionaries Question 3 Explain the following (a) Top-down testin

What is packet switching? explain, Question 1 What are the five subscriber...

Question 1 What are the five subscriber-related signaling functions performed by the operator? Question 2 Compare Microprogrammed control and Hard-wired control Que

Quantitative Methods in Business Decision Making, 4. Union City Al has dec...

4. Union City Al has decided to upgrade their tornado warning system. The city leaders have identified six potential locations for erecting a warning siren tower. They want to e

Library function, Library function :   These are the functions supplied...

Library function :   These are the functions supplied with the programming language. The code or definition of library functions does not have to be written in a user program w

Database, #after writing the script of rebuilting indexed on db server it g...

#after writing the script of rebuilting indexed on db server it gave output command executed succesfully does this mean i m done

Operation research, origin,nature and impact of operation research

origin,nature and impact of operation research

Describe counting instructions, They are used to reduce or enlarge the cont...

They are used to reduce or enlarge the content of the counters. DEC INC DEC INSTRUCTION Idea: To diminish the operator. Syntax: DEC destiny This action subtracts 1 from the destiny

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