To learn more about the newsletter, check our detailed About Page + FAQs
To help me understand you better, please fill out this anonymous, 2-min survey. If you liked this post, make sure you hit the heart icon in this email.
Recommend this publication to Substack over here
Take the next step by subscribing here
Every vote I got on yesterday’s poll said that Google Assistant was funny,
Y’all are the best community online. Impeccable taste. With that out of the way, let’s get right in.
Problem
This problem was asked by PayPal.
Given a string and a number of lines, print the string in a zigzag form. In zigzag, characters are printed out diagonally from top left to bottom right until reaching the kth
line, then back up to the top right, and so on.
For example, given the sentence "thisisazigzag"
and k = 4
, you should print:
Keep reading with a 7-day free trial
Subscribe to Technology Made Simple to keep reading this post and get 7 days of free access to the full post archives.