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

Take all the possible answers with duplicates removed, and return the first one in alphabetical order.

input: "bcabc"

output: "abc"

Nothing. I hadn't fleshed out my idea yet and that's the error I thought could exist. My solution is wrong.
that is a single line of code in javascript, assuming you just want the value in #5 const foo = [...new Set('bcabc'.split(''))].join('')