Answers for "how to list all subarrays in an array python"

1

all subarrays of an array python

import itertools

def allSubArrays(xs):
    n = len(xs)
    indices = list(range(n+1))
    for i,j in itertools.combinations(indices,2):
        yield xs[i:j]
Posted by: Guest on May-13-2021

Code answers related to "how to list all subarrays in an array python"

Python Answers by Framework

Browse Popular Code Answers by Language