Given a list of integers s and a target number k, write a function that returns a subset of s that adds up to k. O (n.k) for dp vector approach 4 : N = 6 nums []
You can choose any subsequence of the array and sum all of its elements together. This problem was asked by google. A subarray is a contiguous part of an array.
Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k. Space optimized to o (k)