What challenges did you face in keeping many API routes clean and organized?
Implement organize_routes(routes) to return route paths in canonical matching order: static segments first, parameterized segments beginning with :, and wildcard segments beginning with *. For equal segment types, sort alphabetically; a route must appear before its deeper child routes.
Input is a list of unique route strings. Return a new list without modifying the input.
/ and contains slash-separated segments:*def organize_routes(routes):