6 kyu

Assemble string

746 of 1,682kirull

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 Trained3171
Total Skips81
Total Code Submissions8499
Total Times Completed1682
JavaScript Completions746
PHP Completions77
COBOL Completions9
Haskell Completions34
Python Completions658
C Completions63
C# Completions159
Total Stars53
% of votes with a positive feedback rating93% of 307
Total "Very Satisfied" Votes271
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