Retired

(NOP) Processing of character strings (retired)

32 of 38Kevin-Haus24

Description:

Lines consisting of characters indicating uppercase letters of the Latin alphabet will be added to the input.

Determine the maximum number of consecutive characters, among which no two letters from the set of letters N, O and P (taking into account repetitions) are written in a row. Spaces should not be taken into account.(ignore spaces altogether)

To perform this task, you should write a function.

Example:

For the AAANAPOAA string, the answer will be 6. 
'PO' divides our line into two lines and the maximum length will be at the first line.

If the line is empty, return 0.

If the string contains a number, return -1.

Good luck!

Stats:

CreatedJun 30, 2023
Warriors Trained83
Total Skips9
Total Code Submissions388
Total Times Completed38
Python Completions32
JavaScript Completions17
C Completions2
Total Stars2
% of votes with a positive feedback rating72% of 27
Total "Very Satisfied" Votes14
Total "Somewhat Satisfied" Votes11
Total "Not Satisfied" Votes2
Total Rank Assessments26
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Kevin-Haus24 Avatar
Ad