File size: 1,451 Bytes
c4bf276
 
73fe88c
c4bf276
 
fc71839
c4bf276
 
 
 
 
 
 
 
 
73fe88c
 
 
 
 
 
 
 
c4bf276
73fe88c
 
 
 
c4bf276
 
 
 
73fe88c
 
 
 
c4bf276
73fe88c
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
lite_metadata:
  gradio_version: 3.32.0
  liteobj_version: 0.0.7
class_string: gradio.interface.Interface
kwargs:
  title: Gradio Webapp
  description: Given an array of distinct integers candidates and a target integer
    target, return a list of all unique combinations of candidates where the chosen
    numbers sum to target
  article: null
  thumbnail: null
  theme: gradio/seafoam
  css: null
  allow_flagging: never
  inputs:
  - class_string: gradio.components.Dataframe
    kwargs:
      label: candidates
      type: array
  - class_string: gradio.components.Number
    kwargs:
      label: target
      precision: 0
  outputs:
  - class_string: gradio.components.Dataframe
    kwargs:
      label: output
      type: array
  fn:
    class_string: gradify.gradify_closure
    kwargs:
      argmaps:
      - label: candidates
        postprocessing: 'lambda array: list(map(int, array[0]))'
      - label: target
        postprocessing: null
      func_kwargs: {}
      source: "def combinationSum(candidates, target):\n    res = []\n\n    def backtrack(start,\
        \ path, target):\n        if target == 0:\n            res.append(path)\n\
        \            return\n        for i in range(start, len(candidates)):\n   \
        \         if candidates[i] > target:\n                break\n            backtrack(i,\
        \ path + [candidates[i]], target - candidates[i])\n    backtrack(0, [], target)\n\
        \    return res\n"