Lurker News
Back to discussion

Comment by 171243

1712433 replies#
input: "bcabc"

  1. "b"
  2. "bc"
  3. "bca"
  4. "bca"
  5. "bca"
What am I missing?
MaximumYComb#
Nothing. I hadn't fleshed out my idea yet and that's the error I thought could exist. My solution is wrong.
kangnkodos#
Take all the possible answers with duplicates removed, and return the first one in alphabetical order.

input: "bcabc"
output: "abc"

pizza_dave#
that is a single line of code in javascript, assuming you just want the value in #5 const foo = [...new Set('bcabc'.split(''))].join('')