Question: Alphabetical Order The function takes two strings (s and t) and determines if t is after s in alphabetical order, longer words come after shorter
Alphabetical Order
The function takes two strings (s and t) and determines if t is after s in alphabetical order, longer words come after shorter words when otherwise identical. Assume strings are not the same.
3.1 Examples
# Input: String s, String t | Output: boolean
# e.g. s = "head", t = "headway" | True (longer word and identical otherwise)
# e.g. s = "think", t = "thought" | True ("thought" is after "think" since o is after i) # e.g. s = "zebra", t = "alpha" | False (a is before z)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
