6 kyu
Duplicate Encoder
103 of 232,139obnounce
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
Similar Kata:
Stats:
Created | Jan 12, 2015 |
Published | Jan 12, 2015 |
Warriors Trained | 495013 |
Total Skips | 69362 |
Total Code Submissions | 883243 |
Total Times Completed | 232139 |
Java Completions | 20652 |
JavaScript Completions | 75462 |
Python Completions | 90353 |
Ruby Completions | 6551 |
C# Completions | 13223 |
PHP Completions | 5307 |
Rust Completions | 2542 |
R Completions | 267 |
Scala Completions | 899 |
Nim Completions | 58 |
C Completions | 2638 |
Elm Completions | 103 |
Haskell Completions | 1101 |
TypeScript Completions | 4280 |
C++ Completions | 8031 |
CoffeeScript Completions | 29 |
Crystal Completions | 40 |
Swift Completions | 1219 |
Julia Completions | 97 |
Go Completions | 3017 |
Clojure Completions | 170 |
COBOL Completions | 11 |
Lua Completions | 60 |
Groovy Completions | 7 |
Total Stars | 4252 |
% of votes with a positive feedback rating | 90% of 19824 |
Total "Very Satisfied" Votes | 16203 |
Total "Somewhat Satisfied" Votes | 3358 |
Total "Not Satisfied" Votes | 263 |