Y
Hacker News
new
|
ask
|
show
|
jobs
by
171243
2354 days ago
input: "bcabc"
1. "b" 2. "bc" 3. "bca" 4. "bca" 5. "bca"
What am I missing?
3 comments
kangnkodos
2354 days ago
Take all the possible answers with duplicates removed, and return the first one in alphabetical order.
input: "bcabc"
output: "abc"
link
MaximumYComb
2354 days ago
Nothing. I hadn't fleshed out my idea yet and that's the error I thought could exist. My solution is wrong.
link
pizza_dave
2354 days ago
that is a single line of code in javascript, assuming you just want the value in #5 const foo = [...new Set('bcabc'.split(''))].join('')
link
input: "bcabc"
output: "abc"