Skip to content

Commit e5c15c8

Browse files
authored
the right slice has the same size as input so space complexity is o(n) (#164)
1 parent 9f1f216 commit e5c15c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

array/product_of_all_other_elements.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package array
22

3-
// ProductOfAllOtherElements solves the problem in O(n) time and O(1) space.
3+
// ProductOfAllOtherElements solves the problem in O(n) time and O(n) space.
44
func ProductOfAllOtherElements(list []int) []int {
55
if len(list) == 0 {
66
return list

0 commit comments

Comments
 (0)