Given two integers n and k, return all possible combinations of k numbers out of the range [1, n].
You may return the answer in any order.
Input: n = 4, k = 2
Note: One of the most typical backtracking problems. Remeber to use spread operator while pushing element into ans because we are passing
path always points to a place in memory and this variable will eventually be empty because of our
undo operations in code. So if we don’t use
spread operator to clone a new array and push it into
ans, what we get will just be empty.