Created
June 1, 2021 05:28
-
-
Save Kush1101/0903d9a532aa2ccacdcaf6be7320a1ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def prefix_of_list(array): | |
ans = [[]] | |
prev = ans[-1] | |
for i in range(len(array)): | |
ans.append(prev + array[i]) | |
return ans | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment