Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Beautiful Strings Programming challenge description: When John was a little kid he didn't have much to do. There was no internet, no Facebook, and no

Beautiful Strings Programming challenge description:

When John was a little kid he didn't have much to do. There was no internet, no Facebook, and no programs to hack on. So he did the only thing he could... he evaluated the beauty of strings in a quest to discover the most beautiful string in the world. Given a string s, little Johnny defined the beauty of the string as the sum of the beauty of the letters in it. The beauty of each letter is an integer between 1 and 26, inclusive, and no two letters have the same beauty. Johnny doesn't care about whether letters are uppercase or lowercase, so that doesn't affect the beauty of a letter. (Uppercase 'F' is exactly as beautiful as lowercase 'f', for example.) You're a student writing a report on the youth of this famous hacker. You found the string that Johnny considered most beautiful. What is the maximum possible beauty of this string?

Input:

Your program should read lines from standard input. Each line is a string.

Output:

Print out the maximum beauty for the string.

Test 1: Input: ABbCcc Output: 152 Test Case #2: Ignore punctuation, please :) 491 Criteria For Solution And Thumbs Up: -PLEASE USE THE EXAMPLE CODE PROVIDED BELOW -PLEASE SOLVE USING PYTHON 3 -WRITE A FULLY ANSWERED, OPTIMIZED, AND DETAILED CODE WITH COMMENTS AND SCREENSHOTS OF CODE AND OUTPUT -WRITE A FULLY EXPLAINED APPROACH ON HOW TO SOLVE IT AND WHY THAT APPROACH -TIME/SPACE COMPLEXITY ALONG WITH THE WHY -ALL TEST CASES MUST PASS Python Example Code: import sys for line in sys.stdin: print(line, end="")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

=+b. What additional effects follow this initial effect?

Answered: 1 week ago

Question

love of humour, often as a device to lighten the occasion;

Answered: 1 week ago

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago