Given a name, turn that name into a perfect square matrix (nested array with the amount of arrays equivalent to the length of each array). 

You will need to add periods (`.`) to the end of the name if necessary, to turn it into a matrix. 

If the name has a length of 0, return `"name must be at least one letter"`

## Examples

"Bill" ==> [ ["B", "i"],
             ["l", "l"] ]

"Frank" ==> [ ["F", "r", "a"],
              ["n", "k", "."],
              [".", ".", "."] ]

Source: codewars | Difficulty: EASY
Tags: Matrices

Data structures

String algorithms

Starter code: def matrixfy(st):
	

Solutions:
from math import ceil

def matrixfy(s):
	if not s:
		return 'name must be at least one letter'
	x = ceil(len(s) ** 0.5)
	it = iter(s.ljust(x * x, '.'))
	return [[next(it) for _ in range(x)] for _ in range(x)]


def matrixfy(st):
	if not st:
		return 'name must be at least one letter'
	n = 1
	while n * n < len(st):
		n += 1
	st += '.' * (n * n - len(st))
	return [list(xs) for xs in zip(*[iter(st)] * n)]


from math import ceil

def matrixfy(stg):
	if not stg:
		return 'name must be at least one letter'
	side = ceil(len(stg) ** 0.5)
	area = side ** 2
	chars = list(stg.ljust(area, '.'))
	return [chars[i:i + side] for i in range(0, area, side)]


from math import ceil

def matrixfy(s):
	if not s:
		return 'name must be at least one letter'
	n = ceil(len(s) ** 0.5)
	return [list(s[x:x + n].ljust(n, '.')) for x in range(0, n * n, n)]


from math import ceil
from itertools import chain, repeat

def matrixfy(st):
	s = ceil(len(st) ** 0.5)
	c = chain(st, repeat('.'))
	return [[next(c) for _ in range(s)] for _ in range(s)] or 'name must be at least one letter'


import math

def matrixfy(st):
	if not st:
		return 'name must be at least one letter'
	side = math.ceil(math.sqrt(len(st)))
	quad = side * side
	st += '.' * (quad - len(st))
	return [list(st[i - side:i]) for i in range(side, quad + 1, side)]


def matrixfy(s):
	n = -int(-len(s) ** 0.5 // 1)
	return list(map(list, zip(*[iter(s.ljust(n * n, '.'))] * n))) or 'name must be at least one letter'


def matrixfy(st):
	import math
	if len(st) == 0:
		return 'name must be at least one letter'
	a = math.ceil(len(st) ** 0.5)
	b = []
	for i in range(a):
		b.append(list(a * '.'))
	for j in range(a):
		for k in range(a):
			if j * a + k == len(st):
				return b
			else:
				b[j][k] = st[j * a + k]
	return b