Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
100 views2 pages

Designer PDF Viewer

The document describes a challenge to calculate the area of a highlighted selection of text in a PDF viewer given letter heights and a string. It provides sample inputs of letter heights and words, along with the corresponding output areas. The task is to use the letter heights to determine the area of the highlighted rectangle when a given word is selected, assuming all letters are 1 unit wide.

Uploaded by

Sunil Shedge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views2 pages

Designer PDF Viewer

The document describes a challenge to calculate the area of a highlighted selection of text in a PDF viewer given letter heights and a string. It provides sample inputs of letter heights and words, along with the corresponding output areas. The task is to use the letter heights to determine the area of the highlighted rectangle when a given word is selected, assuming all letters are 1 unit wide.

Uploaded by

Sunil Shedge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Designer PDF Viewer

When you select a contiguous block of text in a PDF viewer, the selection is highlighted with a blue
rectangle. In this PDF viewer, each word is highlighted independently. For example:

In this challenge, you will be given a list of letter heights in the alphabet and a string. Using the letter
heights given, determine the area of the rectangle highlight in assuming all letters are wide.

Input Format

The first line contains space-separated integers describing the respective heights of each consecutive
lowercase English letter, ascii[a-z].
The second line contains a single word, consisting of lowercase English alphabetic letters.

Constraints

, where is an English lowercase letter.

Word contains no more than letters.

Output Format

Print a single integer denoting the area in of highlighted rectangle when the given word is selected.
Do not print units of measure.

Sample Input 0

13131413255555555555555555
abc

Sample Output 0

Explanation 0

We are highlighting the word abc :

Letter heights are , and . The tallest letter, b , is high. The selection area for this
word is .

Note: Recall that the width of each character is .

Sample Input 1

13131413255555555555555557
zaba

Sample Output 1

28

Explanation 1
The tallest letter in is at . The selection area for this word is .

You might also like