I have an algorithm that I have been thinking for a solution, but I couldn't find a way to solve it.
Find all the subsequences of the array consisting of exactly N elements. For example, given array arr = [1,2,3,4], the subsequences consisting of N=3 elements are: [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
.