Given a string S, find the longest subarray that c ontains only the uppercase letter. If no uppercas e letter is present in the string, print 0. Note String only contains lowercase and uppercase let ters. There will be multiple test cases running so the I nput and Output should match exactly as provid ed. The base Output variable result is set to a default value of -404 which can be modified. Additionall y, you can add or remove these output variables. Input Format The first line of input contains the string S. Sample Input abcdeABCD --denotes S Constraints 0<= S.length() <=1000 Output Format The output contains a single integer denoting th e length of the longest subarray which contains only uppercase letters. Sample Output 4 Explanation ABCD is a subarray that has a length of 4 and c ontains all the uppercase letters only Hence, the answer is 4.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Use python fast 15 minutes
Given a string S, find the longest subarray that c
ontains only the uppercase letter. If no uppercas
e letter is present in the string, print 0.
Note
String only contains lowercase and uppercase let
ters.
There will be multiple test cases running so the I
nput and Output should match exactly as provid
ed.
The base Output variable result is set to a default -
value of -404 which can be modified. Additionall
y, you can add or remove these output variables.
Input Format
The first line of input contains the string S.
Sample Input
abcdeABCD
Constraints
0<= S.length() <=1000
--denotes S
Output Format
The output contains a single integer denoting th
e length of the longest subarray which contains
only uppercase letters.
Sample Output
4
Explanation
ABCD is a subarray that has a length of 4 and c
ontains all the uppercase letters only
Hence, the answer is 4.
Transcribed Image Text:Given a string S, find the longest subarray that c ontains only the uppercase letter. If no uppercas e letter is present in the string, print 0. Note String only contains lowercase and uppercase let ters. There will be multiple test cases running so the I nput and Output should match exactly as provid ed. The base Output variable result is set to a default - value of -404 which can be modified. Additionall y, you can add or remove these output variables. Input Format The first line of input contains the string S. Sample Input abcdeABCD Constraints 0<= S.length() <=1000 --denotes S Output Format The output contains a single integer denoting th e length of the longest subarray which contains only uppercase letters. Sample Output 4 Explanation ABCD is a subarray that has a length of 4 and c ontains all the uppercase letters only Hence, the answer is 4.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education