2022. Convert 1D Array Into 2D Array Leetcode Easy[LIVE CODING]. Asked by FAANG

preview_player
Показать описание
#datascience #datascientist #python #interview #interviews #faang
Рекомендации по теме
Комментарии
Автор

Hello friend, nice solution but there is one problem that is really slowing down your code. You are doing original.pop(0) to extract values from the original list but the problem is that when you pop a list in python, every other element has to be moved down by one which has O(n) time complexity. This is significantly slower than just accessing the correct element by doing original[j] which has O(1) time complexity.

Zephromonia