Designer Pdf Viewer
Solutions We just calculate the resulting area as the product between the number of chars and the maximum height.
Here is a Python implementation:
1 2 3 4 5 6 7 8 9 10 11 def get_rect_height(word, height_arr): height = 0 for c in word: height = max(height, height_arr[ ord(c) - ord("a") ]) #ord(character) gives the ascii value return height heights = [int(x) for x in raw_input().split()] #scan heights word = raw_input() print len(w) * get_rect_height(w, heights) Here is a C++ implementation:
[Read More]