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

What is Assembly Language?, Assembly language is fundamentally the local la...

Assembly language is fundamentally the local language of your computer. In principle the processor of your machine understands machine code (consisting of ones and zeroes). But wit

Hangman, Aim This assignment is intended to assess your skills in understan...

Aim This assignment is intended to assess your skills in understanding and interpreting a moderately complex problem, designing a solution to the problem and implementing the desig

Debugging, Debugging Once a program has been written, it has to ...

Debugging Once a program has been written, it has to be tested first to ensure that it is free of errors. It is very normal that any program written will contain mistake

Database management software, Database Management Software: For storage of...

Database Management Software: For storage of large amounts of varied data, and rapid retrieval and interpretations of data, the database is the ideal tool. It is most useful for s

Explain different types of attacks, Question 1 Explain synchronous and asy...

Question 1 Explain synchronous and asynchronous Data Replication Question 2 Write a short note on Access Time, Latency, Transfer Time, and Streaming Tape Question 3

C programming, a cloth merchant A cloth showroom has announced the followin...

a cloth merchant A cloth showroom has announced the following seasonal discounts on purchase of items: Purchase amount Discount Mill items Handloom items 0-100 - 5% 101-200 5% 7.5%

Networking.., write advantages and disadvantages of private and public netw...

write advantages and disadvantages of private and public network

Inside earth, What are two types of evidence geologists use to learn about ...

What are two types of evidence geologists use to learn about Earth''s interior.?

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