Skip to content

HassanShulli/string-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Zig Zag String Challenge

This is my solution to the zig zag string challenge

Challenge Description

Have the function StringChallenge(strArr) read the array of strings stored in strArr, which will contain two elements, the first some sort of string and the second element will be a number ranging from 1 to 6. The number represents how many rows to print the string on so that it forms a zig-zag pattern. For example: if strArr is ["coderbyte", "3"] then this word will look like the following if you print it in a zig-zag pattern with 3 rows:

c r e o e b t d y

Your program should return the word formed by combining the characters as you iterate through each row, so for this example your program should return the string creoebtdy.

Examples Input: ["cat", "5"] Output: cat Input: ["kaamvjjfl", "4"] Output: kjajfavlm

About

This is my solution to the zig zag string challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors