Coding Interview JavaScript - Pascal's Triangle | Algorithm and Data Structure | ASMR Programming

preview_player
Показать описание
#datastructures #coding #javascript #js #algorithm #code #interview #pascal #triangle
Coding Interview JavaScript - Pascal's Triangle | Algorithm and Datastructure | ASMR Programming
Рекомендации по теме
Комментарии
Автор

bro do u have any other keybaords these switches are killing me lol

also any way to do it prettier? i think classic for loops are ugly as shit.
I stared at this shit for 10m and then open vscode and come up with this bullshit loool:

let triangle = [[1]]
while (triangle.length <= 10) triangle.push([1, ...triangle[triangle.length-1].map((num, i, triangle) => num + triangle[i+1] || 1)])

i mean it does the same thing as urs but idk if it's prettier lol. at first i think i can map reduce it for some reason then im like wait no we wana get bigger lol. any simpler way?
i also had to break it apart into it's parts bc destructuring was confusing my brain as im thinking and im like wait is this not meant to make my code simpler not more confusing lol 😂

creepychris
welcome to shbcf.ru