input: Write a python function to generate all combinations of a given string and length.
  assert combinations("abc", 2) == [['a', 'a'], ['a', 'b'], ['a', 'c'], ['b', 'a'], ['b', 'b'], ['b', 'c'], ['c', 'a'], ['c', 'b'], ['c', 'c']]
  assert combinations("xyz", 3) == [['x', 'x', 'x'], ['x', 'x', 'y'], ['x', 'x', 'z'], ['x', 'y', 'x'], ['x', 'y', 'y'], ['x', 'y', 'z'], ['x', 'z', 'x'], ['x', 'z', 'y'], ['x', 'z', 'z'], ['y', 'x', 'x'], ['y', 'x', 'y'], ['y', 'x', 'z'], ['y', 'y', 'x'], ['y', 'y', 'y'], ['y', 'y', 'z'], ['y', 'z', 'x'], ['y', 'z', 'y'], ['y', 'z', 'z'], ['z', 'x', 'x'], ['z', 'x', 'y'], ['z', 'x', 'z'], ['z', 'y', 'x'], ['z', 'y', 'y'], ['z', 'y', 'z'], ['z', 'z', 'x'], ['z', 'z', 'y'], ['z', 'z', 'z']]
  assert combinations("12", 1) == [['1'], ['2']]
output: def combinations(string, length):
      if length == 0:
          return [[]]
      return [[char] + comb for char in string for comb in combinations(string, length - 1)]