7 kyu

Crossed words

153 of 192sgoi

Description:

Crossed words

This is a fun Kata for crossword lovers!

    S    
    Y    
    N    
    T    
GRAPHICAL
    E    
    S    
    I    
    S    

Task

Write a function that takes two strings as input, and outputs the two words crossing.

Input

Two strings, str1 and str2.

  • There is a maximum of 20 characters for each word.
  • The words may be a different lengths.
  • The words will be in capital letters and have no other characters.
  • The words will always share at least one common letter, so you do not need to worry about invalid cases.

Output

  • Your function should output the first word horizontally and the second word vertically.
  • The words cross at the point of the first instance of a common letter in the second word.
  • A space character is used to fill the blank spaces.
  • Each line ends with the newline character.

Example

str1 = "GRAPHICAL"
str2 = "SYNTHESIS"

returns the sample at the top.

Strings
Algorithms
Logic
Puzzles

Similar Kata:

Stats:

CreatedAug 14, 2018
PublishedAug 17, 2018
Warriors Trained800
Total Skips25
Total Code Submissions1762
Total Times Completed192
JavaScript Completions153
Python Completions48
Total Stars23
% of votes with a positive feedback rating85% of 68
Total "Very Satisfied" Votes51
Total "Somewhat Satisfied" Votes14
Total "Not Satisfied" Votes3
Total Rank Assessments9
Average Assessed Rank
7 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • sgoi Avatar
  • Voile Avatar
  • mauro-1 Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad