6 kyu

Assemble string

743 of 1,669kirull

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 Trained3148
Total Skips81
Total Code Submissions8390
Total Times Completed1669
JavaScript Completions743
PHP Completions75
COBOL Completions9
Haskell Completions34
Python Completions653
C Completions62
C# Completions155
Total Stars53
% of votes with a positive feedback rating93% of 304
Total "Very Satisfied" Votes268
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