This problem was asked by PayPal.
Given a string and a number of lines k, print the string in zigzag form. In zigzag, characters are printed out diagonally from top left to bottom right until reaching the kth line, then back up to top right, and so on.
For example, given the sentence "thisisazigzag" and k = 4, you should print:
t a g
h s z a
i i i z
s g
This problem was asked by Salesforce.
Given an array of integers, find the maximum XOR of any two elements.
This problem was asked by Etsy.
Given an array of numbers N and an integer k, your task is to split N into k partitions
such that the maximum sum of any partition is minimized. Return this sum.
For example, given N = [5, 1, 2, 7, 3, 4] and k = 3, you should return 8,
since the optimal partition is
[5, 1, 2], [7], [3, 4].