Deepest shared path
Your task
Two services report their working directories as absolute Unix-style paths (they start with '/' and contain segments separated by single slashes, e.g. '/home/dev/app'). Return the deepest path both share, comparing whole segments, '/x/y' and '/x/yy' share only '/x', not '/x/y'. Return '/' when nothing beyond the root is shared. For example, '/home/dev/app/logs' and '/home/dev/api' share '/home/dev'.
Examples
common_path(a: str, b: str) -> strExample 1
Input
common_path("/home/dev/app/logs", "/home/dev/api")Output
"/home/dev"