Given a string with hierarchical delimiters — '/' separates major parts and '.' separates minor parts — compress each segment by keeping its first character, the count of middle characters, and its last character (e.g., 'abcd/erfgsh/google.com.abc' → 'a2d/e4h/g4e.c1m.a1c'). Part 1: Apply this compression independently to every minor-part segment (delimited by…