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.
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.
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 19RQ
Related questions
Question
Use python fast 15 minutes
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
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
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT