Create a triangle
Modify the function to return a 2D list which itself represents a triangle filled with the same symbol passed to the function. The function should accept two arguments - the height of the triangle and the symbol which needs to be filled in that triangle. If there is no value provided, the triangle needs to be filled with
#
.Input | Output |
3 * | [['*'],
['*', '*'],
['*', '*', '*']] |
2 | [['#'],
['#', '#']] |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB