Join URL/POSIX path segments with / and normalize:
/
solve(['/a', 'b', '/c/']) → '/a/b/c/' (preserves trailing slash of last segment).
solve(['/a', 'b', '/c/'])
'/a/b/c/'
Sample tests