Codewars DuplicateEncoder Java solution

Published: 17 December 2021
on channel: Dave Kirkwood
613
9

Duplicate Encoder is the third exercise that I have tried in CodeWars. Its a 6 kyu task. A string has to be converted into a series of brackets of the same length as the string. An open bracket is required if the character appears only once in the original string and a closed bracket represents a character that appears more than once in the original string.

My solution first loops through the string and counts each of the characters. It then loops back through the original string to create the sequence of brackets, based on the count of characters from the first loop.


On this page of the site you can watch the video online Codewars DuplicateEncoder Java solution with a duration of hours minute second in good quality, which was uploaded by the user Dave Kirkwood 17 December 2021, share the link with friends and acquaintances, this video has already been watched 613 times on youtube and it was liked by 9 viewers. Enjoy your viewing!