6 kyu

Diagonal Strings

82 of 254frkn2076

Description:

In this kata, you have a string array has N elements and each element of array has N length(NxN).

For Example: {"abcd","kata","1234","qwer"}

You must first sort the array alphabetically. And output consists of letters obtained diagonally (from upper left to lower right).

For Example:

  1234                       abcd                           
  abcd                       kata                           
  kata                       qwer                           
  qwer -> 1234 => "1btr"     1234 -> abcd => "aae4"         
   
  kata                       qwer
  qwer                       1234
  1234                       abcd
  abcd -> kata => "kw3d"     kata -> qwer => "q2ca"

  Output : {"aae4","kw3d","1btr","q2ca"} (by input order)
    

TASK:
Write a function that accepts a square(NxN) array and returns diagonal strings as array (as the order of input array).

NOTES:
If input array is not square(NxN) (array with 0 length is not accept as square too) returns null.

  • You must return error, for the above case in Go language.
Fundamentals

More By Author:

Check out these other kata created by frkn2076

Stats:

CreatedFeb 20, 2019
PublishedFeb 20, 2019
Warriors Trained1115
Total Skips221
Total Code Submissions2039
Total Times Completed254
C# Completions82
Dart Completions61
Go Completions32
JavaScript Completions87
Total Stars28
% of votes with a positive feedback rating72% of 78
Total "Very Satisfied" Votes47
Total "Somewhat Satisfied" Votes18
Total "Not Satisfied" Votes13
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • frkn2076 Avatar
  • Unnamed Avatar
  • monadius Avatar
  • hobovsky Avatar
Ad