Create a function hollow_triangle(height) that returns a hollow triangle of the correct height. The height is passed through to the function and the function should return a list containing each line of the hollow triangle. 
```
hollow_triangle(6) should return : ['_____#_____', '____#_#____', '___#___#___', '__#_____#__', '_#_______#_', '###########']
hollow_triangle(9) should return : ['________#________', '_______#_#_______', '______#___#______', '_____#_____#_____', '____#_______#____', '___#_________#___', '__#___________#__', '_#_____________#_', '#################']
```
The final idea is for the hollow triangle is to look like this if you decide to print each element of the list: 
``` 
hollow_triangle(6) will result in:
_____#_____              1
____#_#____              2
___#___#___              3
__#_____#__              4
_#_______#_              5
###########              6 ---- Final Height

hollow_triangle(9) will result in:
________#________        1
_______#_#_______        2
______#___#______        3
_____#_____#_____        4      
____#_______#____        5
___#_________#___        6
__#___________#__        7
_#_____________#_        8
#################        9 ---- Final Height
```
Pad spaces with underscores i.e _ so each line is the same length.Goodluck and have fun coding !

Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code:
def hollow_triangle(n):
	

Solutions:
def hollow_triangle(n):
	width = n * 2 - 1
	row = '{{:_^{}}}'.format(width).format
	return [row(mid(a)) for a in xrange(1, width, 2)] + [width * '#']

def mid(n):
	return '#' if n == 1 else '#{}#'.format('_' * (n - 2))


def hollow_triangle(n):
	(w, result) = (2 * n - 1, [f"{'_' * (2 * i - 1):#^{2 * i + 1}}" for i in range(n - 1)])
	return [f'{l:_^{w}}' for l in result] + ['#' * w]


hollow_triangle = lambda n: [''.join([['_', '#'][k in [n - 1 - i, n - 1 + i]] for k in range(n * 2 - 1)]) for i in range(n - 1)] + [f"{'#' * (n * 2 - 1)}"]


def hollow_triangle(n):
	return [(f"#{'_' * (2 * i - 1)}#" if i else '#').center(2 * n - 1, '_') for i in range(n - 1)] + ['#' * (2 * n - 1)]


def hollow_triangle(n):
	return ['_' * (n - i - 1) + '#' + '_' * (2 * i - 1) + '#' * (i >= 1) + '_' * (n - i - 1) for i in range(n - 1)] + ['#' * (2 * n - 1)]


def hollow_triangle(n):
	if n == 1:
		return ['#']
	first = ['_' * (n - 1) + '#' + '_' * (n - 1)]
	last = ['#' * (2 * n - 1)]
	return first + ['_' * (n - i - 1) + '#' + '_' * (2 * i - 1) + '#' + '_' * (n - i - 1) for i in range(1, n - 1)] + last


def hollow_triangle(n):
	total_width = 2 * n - 1
	triangle = ['#'.center(total_width, '_')]
	for i in range(1, total_width - 2, 2):
		triangle.append('#{}#'.format('_' * i).center(total_width, '_'))
	triangle.append('#' * total_width)
	return triangle


(m, hollow_triangle) = (lambda s: s[:0:-1] + s, lambda n: [m('_' * i + '#' + '_' * (n - i - 1)) for i in range(n - 1)] + [m(n * '#')])


def hollow_triangle(n):
	lines = ['_' * (n - i - 1) + '#' + '_' * (2 * i - 1) + '#' + '_' * (n - i - 1) for i in range(1, n - 1)]
	return ['_' * (n - 1) + '#' + '_' * (n - 1)] + lines + ['#' * (2 * n - 1)] if n > 1 else ['#']


def hollow_triangle(n):
	ans = []
	for i in range(n - 1, 0, -1):
		x = '_' * i + '#' + '_' * (n - i - 1)
		ans.append(x[:-1] + x[::-1])
	return ans + ['#' * (2 * n - 1)]