Problem statement
Write function solution(labels). Inputs and outputs are JSON values. Do not modify input arrays or objects. External libraries, network access, and asynchronous functions are not supported. labels:string[]. Normalize NFKC, trim, lowercase, replace runs outside Unicode letters/numbers with one hyphen, remove leading/trailing hyphens. Use 'untitled' for an empty result. Preserve input order. Input limits: at most 50,000 items per input array and 1,000 characters per string. Numbers are finite; integers and accumulated integer results stay in the JavaScript safe-integer range. Other types and validity rules follow the statement above.
Example input and output
Example 1
Function arguments
[
[
" Hello World ",
"A_B"
]
]Return value
[ "hello-world", "a-b" ]
Example 2
Function arguments
[
[
"서울 사진전",
"Cafe"
]
]Return value
[ "서울-사진전", "cafe" ]
Example 3
Function arguments
[
[
"a---b",
"x/y"
]
]Return value
[ "a-b", "x-y" ]