Problem ยท String
Check Alphabetical Order ๐ธ
Learn this problemProblem statement
The input consists of a string - inputString, representing the given string.
Print '0' if the given string is in alphabetical order. If not print the index of the character where it is out of alphabetical order.
Function
checkAlphabeticalOrder(inputString: String) โ intExamples
Example 1
inputString = "abc"return = 0The given string "abc" is in alphabetical order, so the output is '0'.
Example 2
inputString = "asd"return = 2The given string "asd" is not in alphabetical order, and the character at index '2' is where it is out of order.
Constraints
Unknown for nowMore Cisco problems
- Collect CoinsSeen Jun 2025
- FizzBuzz ProblemSeen May 2025
- Find Largest Sum Contiguous SubarraySeen May 2025
- Find Largest Sum of Continuous SequenceSeen May 2025
- Find Palindrome Sub-stringSeen May 2025
- Count Numbers with Digit SumSeen Mar 2025
- Maximum Chocolates from Jars (L.C. 198 :)Seen Mar 2025
- Find Elements Largest in Row Smallest in ColumnSeen Mar 2025