# Task

**Your task** is to implement function `printNumber` (`print_number` in C/C++ and Python `Kata.printNumber` in Java) that returns string that represents given number in text format (see examples below).

Arguments:
 - `number` — Number that we need to print (`num` in C/C++/Java)
 - `char` — Character for building number (`ch` in C/C++/Java)

# Examples
```c,python
print_number(99, '$')
//Should return
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n
//$                                      $\n
//$   $$$$   $$$$   $$$$   $$$$   $$$$   $\n
//$  $$  $$ $$  $$ $$  $$ $$  $$ $$  $$  $\n
//$  $$  $$ $$  $$ $$  $$ $$  $$ $$  $$  $\n
//$  $$  $$ $$  $$ $$  $$  $$$$   $$$$   $\n
//$  $$  $$ $$  $$ $$  $$   $$     $$    $\n
//$   $$$$   $$$$   $$$$   $$     $$     $\n
//$                                      $\n
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

print_number(12345, '*')
//Should return
//****************************************\n
//*                                      *\n
//*    **    ****   ****  **  ** ******  *\n
//*   ***   **  ** **  ** **  ** **      *\n
//*  * **      **     **  **  ** *****   *\n
//*    **     **      **   *****     **  *\n
//*    **    **    **  **     **     **  *\n
//*  ****** ******  ****      ** *****   *\n
//*                                      *\n
//****************************************

print_number(67890, '@')
//Should return
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n
//@                                      @\n
//@     @@  @@@@@@  @@@@   @@@@   @@@@   @\n
//@    @@   @@  @@ @@  @@ @@  @@ @@  @@  @\n
//@   @@@@     @@   @@@@  @@  @@ @@  @@  @\n
//@  @@  @@   @@    @@@@   @@@@  @@  @@  @\n
//@  @@  @@  @@    @@  @@   @@   @@  @@  @\n
//@   @@@@   @@     @@@@   @@     @@@@   @\n
//@                                      @\n
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
```
>***Note, that***:
 - Number should be `0 <= number <= 99999` and have `5 digits` (should have zeros at the start if needed)
 - Test cases contains only valid values (integers that are 0 <= number <= 99999) and characters
 - Numbers should have the same shape as in the examples (6x6 by the way)
 - Returned string should be joined by `\n` character (except of the end)
 - Returned string should have 1 character *(height)* border (use the same character as for number) + padding (1 character in height vertical and 2 horizontal with ` `) around borders and 1 character margin between "digits"
 
 *Suggestions and translations are welcome.*

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def print_number(number, char):
	

Solutions:
L = ((' #### ', '  ##  ', ' #### ', ' #### ', '##  ##', '######', '   ## ', '######', ' #### ', ' #### ').__getitem__, ('##  ##', ' ###  ', '##  ##', '##  ##', '##  ##', '##    ', '  ##  ', '##  ##', '##  ##', '##  ##').__getitem__, ('##  ##', '# ##  ', '   ## ', '   ## ', '##  ##', '##### ', ' #### ', '   ## ', ' #### ', '##  ##').__getitem__, ('##  ##', '  ##  ', '  ##  ', '   ## ', ' #####', '    ##', '##  ##', '  ##  ', ' #### ', ' #### ').__getitem__, ('##  ##', '  ##  ', ' ##   ', '##  ##', '    ##', '    ##', '##  ##', ' ##   ', '##  ##', '  ##  ').__getitem__, (' #### ', '######', '######', ' #### ', '    ##', '##### ', ' #### ', ' ##   ', ' #### ', ' ##   ').__getitem__)

def print_number(number, char):
	(s1, s2, l) = ('#' * 40, f"#{' ' * 38}#", list(map(int, f'{number:05}')))
	return '\n'.join([s1, s2] + [f"#  {' '.join(map(L[i], l))}  #" for i in range(6)] + [s2, s1]).replace('#', char)


example_text = '\n//*    **    ****   ****  **  ** ******  *\\n\n//*   ***   **  ** **  ** **  ** **      *\\n\n//*  * **      **     **  **  ** *****   *\\n\n//*    **     **      **   *****     **  *\\n\n//*    **    **    **  **     **     **  *\\n\n//*  ****** ******  ****      ** *****   *\\n\n//@     @@  @@@@@@  @@@@   @@@@   @@@@   @\\n\n//@    @@   @@  @@ @@  @@ @@  @@ @@  @@  @\\n\n//@   @@@@     @@   @@@@  @@  @@ @@  @@  @\\n\n//@  @@  @@   @@    @@@@   @@@@  @@  @@  @\\n\n//@  @@  @@  @@    @@  @@   @@   @@  @@  @\\n\n//@   @@@@   @@     @@@@   @@     @@@@   @\\n\n'
example_text = [l[5:-4] for l in example_text.replace('@', '*').split('\n') if l.strip()]
SUPER_DIGITS = []
for super_line in [example_text[:6], example_text[6:]]:
	for i in range(5):
		SUPER_DIGITS.append([line[i * 7:(i + 1) * 7] for line in super_line])
SUPER_DIGITS.insert(0, SUPER_DIGITS.pop(-1))

def print_number(number, char):
	digits = str(number).rjust(5, '0')
	lines = ['' for _ in range(6)]
	for d in digits:
		for i in range(6):
			lines[i] += SUPER_DIGITS[int(d)][i]
	lines = [f'  {l} ' for l in lines]
	width = len(lines[0])
	lines.insert(0, '*' * width)
	lines.insert(1, ' ' * width)
	lines.append(' ' * width)
	lines.append('*' * width)
	lines = [f'*{l}*' for l in lines]
	return '\n'.join(lines).replace('*', char)


def print_number(number, char):
	separator_arr = [' ' for i in range(10)]
	separator_arr[0] = char
	separator_arr[9] = char
	border_arr = [char for i in range(10)]
	char_2 = char * 2
	char_3 = char * 3
	char_4 = char * 4
	char_5 = char * 5
	char_6 = char * 6
	space_2 = ' ' * 2
	space_3 = ' ' * 3
	space_4 = ' ' * 4
	space_6 = ' ' * 6
	sccccs = f' {char_4} '
	ccsscc = f'{char_2}{space_2}{char_2}'
	ssccss = f'{space_2}{char_2}{space_2}'
	sssccs = f'{space_3}{char_2} '
	sccsss = f' {char_2}{space_3}'
	sssscc = f'{space_4}{char_2}'
	ccssss = f'{char_2}{space_4}'
	cccccs = f'{char_5} '
	sssccs = f'{space_3}{char_2} '
	digits = {'0': [char_6, space_6, sccccs, ccsscc, ccsscc, ccsscc, ccsscc, sccccs, space_6, char_6], '1': [char_6, space_6, ssccss, f' {char_3}{space_2}', f'{char} {char_2}{space_2}', ssccss, ssccss, char_6, space_6, char_6], '2': [char_6, space_6, sccccs, ccsscc, sssccs, ssccss, sccsss, char_6, space_6, char_6], '3': [char_6, space_6, sccccs, ccsscc, sssccs, sssccs, ccsscc, sccccs, space_6, char_6], '4': [char_6, space_6, ccsscc, ccsscc, ccsscc, f' {char_5}', sssscc, sssscc, space_6, char_6], '5': [char_6, space_6, char_6, ccssss, cccccs, sssscc, sssscc, cccccs, space_6, char_6], '6': [char_6, space_6, sssccs, ssccss, sccccs, ccsscc, ccsscc, sccccs, space_6, char_6], '7': [char_6, space_6, char_6, ccsscc, sssccs, ssccss, sccsss, sccsss, space_6, char_6], '8': [char_6, space_6, sccccs, ccsscc, sccccs, sccccs, ccsscc, sccccs, space_6, char_6], '9': [char_6, space_6, sccccs, ccsscc, ccsscc, sccccs, ssccss, sccsss, space_6, char_6]}

	def normalize(n):
		if n > 9999:
			return str(n)
		else:
			return str(n).rjust(5, '0')
	num = normalize(number)
	final_result = []
	for i in range(10):
		final_result.append(f'{border_arr[i]}{separator_arr[i]}{separator_arr[i]}{digits[num[0]][i]}{separator_arr[i]}{digits[num[1]][i]}{separator_arr[i]}{digits[num[2]][i]}{separator_arr[i]}{digits[num[3]][i]}{separator_arr[i]}{digits[num[4]][i]}{separator_arr[i]}{separator_arr[i]}{border_arr[i]}')
	return '\n'.join(final_result)


import sys

def print_number(num, char):
	num = str(num).rjust(5, '0')
	A = [[' **** ', '  **  ', ' **** ', ' **** ', '**  **', '******', '   ** ', '******', ' **** ', ' **** '], ['**  **', ' ***  ', '**  **', '**  **', '**  **', '**    ', '  **  ', '**  **', '**  **', '**  **'], ['**  **', '* **  ', '   ** ', '   ** ', '**  **', '***** ', ' **** ', '   ** ', ' **** ', '**  **'], ['**  **', '  **  ', '  **  ', '   ** ', ' *****', '    **', '**  **', '  **  ', ' **** ', ' **** '], ['**  **', '  **  ', ' **   ', '**  **', '    **', '    **', '**  **', ' **   ', '**  **', '  **  '], [' **** ', '******', '******', ' **** ', '    **', '***** ', ' **** ', ' **   ', ' **** ', ' **   ']]
	Out = '\n'.join([char * 40, char + ' ' * 38 + char, ''])
	for r in range(6):
		Out += char + '  ' + ' '.join((A[r][int(c)].replace('*', char) for c in num)) + '  ' + char + '\n'
	Out += '\n'.join([char + ' ' * 38 + char, char * 40])
	return Out


def print_number(number, char):
	dct = {'1': ['  **  ', ' ***  ', '* **  ', '  **  ', '  **  ', '******'], '2': [' **** ', '**  **', '   ** ', '  **  ', ' **   ', '******'], '3': [' **** ', '**  **', '   ** ', '   ** ', '**  **', ' **** '], '4': ['**  **', '**  **', '**  **', ' *****', '    **', '    **'], '5': ['******', '**    ', '***** ', '    **', '    **', '***** '], '6': ['   ** ', '  **  ', ' **** ', '**  **', '**  **', ' **** '], '7': ['******', '**  **', '   ** ', '  **  ', ' **   ', ' **   '], '8': [' **** ', '**  **', ' **** ', ' **** ', '**  **', ' **** '], '9': [' **** ', '**  **', '**  **', ' **** ', '  **  ', ' **   '], '0': [' **** ', '**  **', '**  **', '**  **', '**  **', ' **** ']}
	s = str(number).zfill(5)
	top = [char * 40, char + ' ' * 38 + char]
	bottom = [char + ' ' * 38 + char, char * 40]
	middle = []
	for i in range(6):
		row = []
		for dig in s:
			row.append(dct[dig][i].replace('*', char) + ' ')
		middle.append('{0}  {1} {0}'.format(char, ''.join(row)))
	return '\n'.join(top + middle + bottom)


def print_number(number, char):

	def str_cif(tupl, sym):
		rez = ''
		for i in tupl:
			if i == 1:
				rez += sym
			else:
				rez += ' '
		return rez
	razv = (((0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 0)), ((0, 0, 1, 1, 0, 0), (0, 1, 1, 1, 0, 0), (1, 0, 1, 1, 0, 0), (0, 0, 1, 1, 0, 0), (0, 0, 1, 1, 0, 0), (1, 1, 1, 1, 1, 1)), ((0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (0, 0, 0, 1, 1, 0), (0, 0, 1, 1, 0, 0), (0, 1, 1, 0, 0, 0), (1, 1, 1, 1, 1, 1)), ((0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (0, 0, 0, 1, 1, 0), (0, 0, 0, 1, 1, 0), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 0)), ((1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 1), (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 1)), ((1, 1, 1, 1, 1, 1), (1, 1, 0, 0, 0, 0), (1, 1, 1, 1, 1, 0), (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 1), (1, 1, 1, 1, 1, 0)), ((0, 0, 0, 1, 1, 0), (0, 0, 1, 1, 0, 0), (0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 0)), ((1, 1, 1, 1, 1, 1), (1, 1, 0, 0, 1, 1), (0, 0, 0, 1, 1, 0), (0, 0, 1, 1, 0, 0), (0, 1, 1, 0, 0, 0), (0, 1, 1, 0, 0, 0)), ((0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 0), (0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 0)), ((0, 1, 1, 1, 1, 0), (1, 1, 0, 0, 1, 1), (1, 1, 0, 0, 1, 1), (0, 1, 1, 1, 1, 0), (0, 0, 1, 1, 0, 0), (0, 1, 1, 0, 0, 0)))
	shap = char * 40 + '\n' + char + ' ' * 38 + char + '\n'
	podv = char + ' ' * 38 + char + '\n' + char * 40
	str_number = '0' * (5 - len(str(number))) + str(number)
	num_prn = [int(i) for i in str_number]
	body = ''
	for i in range(6):
		body += char + '  '
		for n in num_prn:
			body += str_cif(razv[n][i], char) + ' '
		body += ' ' + char + '\n'
	return shap + body + podv


def modify(M, n, r, c):
	if n == 0:
		M[r][c] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c + 2] = ' '
		M[r + 2][c + 3] = ' '
		M[r + 3][c + 2] = ' '
		M[r + 3][c + 3] = ' '
		M[r + 4][c + 2] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 5] = ' '
	if n == 1:
		M[r][c] = ' '
		M[r][c + 1] = ' '
		M[r][c + 4] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c] = ' '
		M[r + 1][c + 4] = ' '
		M[r + 1][c + 5] = ' '
		M[r + 2][c + 1] = ' '
		M[r + 2][c + 4] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 1] = ' '
		M[r + 3][c + 4] = ' '
		M[r + 3][c + 5] = ' '
		M[r + 4][c] = ' '
		M[r + 4][c + 1] = ' '
		M[r + 4][c + 4] = ' '
		M[r + 4][c + 5] = ' '
	if n == 2:
		M[r][c] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c] = ' '
		M[r + 2][c + 1] = ' '
		M[r + 2][c + 2] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 1] = ' '
		M[r + 3][c + 4] = ' '
		M[r + 3][c + 5] = ' '
		M[r + 4][c] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 4][c + 4] = ' '
		M[r + 4][c + 5] = ' '
	if n == 3:
		M[r][c] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c] = ' '
		M[r + 2][c + 1] = ' '
		M[r + 2][c + 2] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 1] = ' '
		M[r + 3][c + 2] = ' '
		M[r + 3][c + 5] = ' '
		M[r + 4][c + 2] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 5] = ' '
	if n == 4:
		M[r][c + 2] = ' '
		M[r][c + 3] = ' '
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c + 2] = ' '
		M[r + 2][c + 3] = ' '
		M[r + 3][c] = ' '
		M[r + 4][c] = ' '
		M[r + 4][c + 1] = ' '
		M[r + 4][c + 2] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 1] = ' '
		M[r + 5][c + 2] = ' '
		M[r + 5][c + 3] = ' '
	if n == 5:
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 1][c + 4] = ' '
		M[r + 1][c + 5] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 1] = ' '
		M[r + 3][c + 2] = ' '
		M[r + 3][c + 3] = ' '
		M[r + 4][c] = ' '
		M[r + 4][c + 1] = ' '
		M[r + 4][c + 2] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 5][c + 5] = ' '
	if n == 6:
		M[r][c] = ' '
		M[r][c + 1] = ' '
		M[r][c + 2] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c] = ' '
		M[r + 1][c + 1] = ' '
		M[r + 1][c + 4] = ' '
		M[r + 1][c + 5] = ' '
		M[r + 2][c] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c + 2] = ' '
		M[r + 3][c + 3] = ' '
		M[r + 4][c + 2] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 5] = ' '
	if n == 7:
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c] = ' '
		M[r + 2][c + 1] = ' '
		M[r + 2][c + 2] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 1] = ' '
		M[r + 3][c + 4] = ' '
		M[r + 3][c + 5] = ' '
		M[r + 4][c] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 4][c + 4] = ' '
		M[r + 4][c + 5] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 3] = ' '
		M[r + 5][c + 4] = ' '
		M[r + 5][c + 5] = ' '
	if n == 8:
		M[r][c] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c] = ' '
		M[r + 2][c + 5] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 5] = ' '
		M[r + 4][c + 2] = ' '
		M[r + 4][c + 3] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 5] = ' '
	if n == 9:
		M[r][c] = ' '
		M[r][c + 5] = ' '
		M[r + 1][c + 2] = ' '
		M[r + 1][c + 3] = ' '
		M[r + 2][c + 2] = ' '
		M[r + 2][c + 3] = ' '
		M[r + 3][c] = ' '
		M[r + 3][c + 5] = ' '
		M[r + 4][c] = ' '
		M[r + 4][c + 1] = ' '
		M[r + 4][c + 4] = ' '
		M[r + 4][c + 5] = ' '
		M[r + 5][c] = ' '
		M[r + 5][c + 3] = ' '
		M[r + 5][c + 4] = ' '
		M[r + 5][c + 5] = ' '

def print_number(number, char):
	M = [[char for _ in range(40)] for _ in range(10)]
	for i in range(1, 39):
		M[1][i] = ' '
		M[8][i] = ' '
	for i in range(2, 8):
		for j in [1, 2, 9, 16, 23, 30, 37, 38]:
			M[i][j] = ' '
	N = str(number).zfill(5)
	P = [(2, 3), (2, 10), (2, 17), (2, 24), (2, 31)]
	for i in range(5):
		(r, c) = P[i]
		modify(M, int(N[i]), r, c)
	o = ''
	for e in M:
		o += ''.join(e) + '\n'
	return o[:-1]