In Uber's routing system, each planned ride route is represented as a sequence of lowercase letters in the string rideRoute, where each character corresponds to a checkpoint.
A segment of the route is defined as any non-empty consecutive portion of rideRoute. A segment is considered special if:
The task is to determine the number of distinct special segments that exist within the given rideRoute.
rideRoute = "uber" Route Segments of "uber" are:
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.