2022. Convert 1D Array Into 2D Array (Leetcode Easy)

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

Were you able to step up the dimensions?

Algorithmist
Автор

this code doesnt work for [1, 1, 1, 1] R=4, C=1

correct code:
if len(original) != m * n:
return []
matrix = []
for i in range(m):
matrix.append(original[i*n : (i*n) + n])
return matrix

SiddhantSancheti-kkzd
Автор

Can u please share your insights on how to use leetcode effectively as I have just started solving Qs on leetcode?

cherish