Ask a Question

 

Start Coding Today

   

GeeksQuiz

GeeksforGeeksIDE

Data Structures

Algorithms

Interview Experiences

C Programming

C++ Programming

Java Programming

GATE CS

Books

Given a description of a string, you must determine its maximum possible nesting level.

Input : The input consists of two lines. The first line contains an integer n (1 ≤ n ≤ 100). The second line contains n integers a1, a2, . . . , an (1 ≤ ai ≤ 100), which describe a string as follows. The string starts with a1 quote characters, which are followed by a positive number of non-quote characters, which are followed by a2 quote characters, which are followed by a positive number of non-quote characters, and so on, until the string ends with an quote characters. Outputs : Display the largest number k such that a string described by the input is a k-quotation. If there is no such k, display no quotation instead.
asked Jan 9 by qwertyuiop

Please log in or register to answer this question.

...