6 kyu

Assemble string

753 of 1,701kirull

Description:

Task

In this task, you need to restore a string from a list of its copies.

You will receive an array of strings. All of them are supposed to be the same as the original but, unfortunately, they were corrupted which means some of the characters were replaced with asterisks ("*").

You have to restore the original string based on non-corrupted information you have. If in some cases it is not possible to determine what the original character was, use "#" character as a special marker for that.

If the array is empty, then return an empty string.

Examples:

input = [
  "a*cde",
  "*bcde",
  "abc*e"
]
result = "abcde"


input = [
  "a*c**",
  "**cd*",
  "a*cd*"
]
result = "a#cd#"
Strings
Arrays
Fundamentals

More By Author:

Check out these other kata created by kirull

Stats:

CreatedFeb 19, 2022
PublishedFeb 19, 2022
Warriors Trained3217
Total Skips81
Total Code Submissions8546
Total Times Completed1701
JavaScript Completions753
PHP Completions79
COBOL Completions9
Haskell Completions34
Python Completions663
C Completions67
C# Completions160
Total Stars53
% of votes with a positive feedback rating93% of 309
Total "Very Satisfied" Votes273
Total "Somewhat Satisfied" Votes28
Total "Not Satisfied" Votes8
Total Rank Assessments21
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • kirull Avatar
  • bouchert Avatar
  • JohanWiltink Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • akar-0 Avatar
  • Insisted Avatar
  • NikCSharp Avatar
Ad