DEV Community

Discussion on: Can you solve this interview problem?

Collapse
 
microtot profile image
MicroTot • Edited

This is the worst implementation here, but it workd

let url = ["aHR0cHM", "6Ly9kZXYudG", "8vMHNodXZvMC",  "9jb21tZW5",  "0LzFqZTFt" ]
var joinedUrl = url.join()
console.log(joinedUrl)

var result = joinedUrl.replace(/,/g, "")
var decoded = atob(result)
console.log(decoded)
Enter fullscreen mode Exit fullscreen mode

Output:

[LOG]: "https://dev.to/0shuvo0/comment/1je1m" 
Enter fullscreen mode Exit fullscreen mode