6 kyu

Duplicate Encoder

20,671 of 232,381obnounce

Description:

The goal of this exercise is to convert a string to a new string where each character in the new string is "(" if that character appears only once in the original string, or ")" if that character appears more than once in the original string. Ignore capitalization when determining if a character is a duplicate.

Examples

"din"      =>  "((("
"recede"   =>  "()()()"
"Success"  =>  ")())())"
"(( @"     =>  "))((" 

Notes

Assertion messages may be unclear about what they display in some languages. If you read "...It Should encode XXX", the "XXX" is the expected result, not the input!

Strings
Arrays
Fundamentals

Stats:

CreatedJan 12, 2015
PublishedJan 12, 2015
Warriors Trained495463
Total Skips69397
Total Code Submissions883936
Total Times Completed232381
Java Completions20671
JavaScript Completions75525
Python Completions90466
Ruby Completions6552
C# Completions13236
PHP Completions5311
Rust Completions2543
R Completions267
Scala Completions899
Nim Completions58
C Completions2641
Elm Completions103
Haskell Completions1103
TypeScript Completions4290
C++ Completions8046
CoffeeScript Completions29
Crystal Completions40
Swift Completions1219
Julia Completions97
Go Completions3024
Clojure Completions170
COBOL Completions11
Lua Completions61
Groovy Completions7
Total Stars4254
% of votes with a positive feedback rating90% of 19830
Total "Very Satisfied" Votes16209
Total "Somewhat Satisfied" Votes3358
Total "Not Satisfied" Votes263
Ad
Contributors
  • obnounce Avatar
  • jhoffner Avatar
  • charger Avatar
  • ZozoFouchtra Avatar
  • Azuaron Avatar
  • GiacomoSorbi Avatar
  • bangbang93 Avatar
  • anter69 Avatar
  • gttotev Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • user5036852 Avatar
  • Blind4Basics Avatar
  • wneumann Avatar
  • pavloslav Avatar
  • mbuscemi Avatar
  • rowcased Avatar
  • mentalplex Avatar
  • tebek Avatar
  • danmbyrd Avatar
  • metagn Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • stellartux Avatar
  • AxF Avatar
  • trashy_incel Avatar
  • Aizaz_Ahmad Avatar
  • user8436785 Avatar
  • qmstuart Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • FranzMartyn Avatar
  • KayleighWasTaken Avatar
  • metatable Avatar
Ad