Skip to content

Commit cfb2d93

Browse files
committed
Update example and fix docsFormat
1 parent fbaf2ce commit cfb2d93

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

content/examples.ts

+12-18
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,20 @@ export default [
1414
return ltrs[new_index]`,
1515
},
1616
{
17-
id: 'maximum',
17+
id: 'treeVertex',
1818
languageId: 'python',
1919
format: 'reST',
20-
code: `def maximum_subarray():
21-
str_input = (','.join(i for i in sys.argv[1:])).strip()
22-
if str_input == "":
23-
print("Usage: Please provide a list of at least two integers to sort in the format: '1, 2, 3, 4, 5'")
24-
return
25-
26-
arr = [int(num) for num in str_input.split(',')]
27-
ans = 0
28-
curr_sum = 0
29-
for i in range(len(arr)):
30-
if (curr_sum + arr[i] > 0):
31-
curr_sum += arr[i]
32-
else:
33-
curr_sum = 0
34-
ans = max(ans, curr_sum)
35-
print(ans)
36-
return`,
20+
code: `def create_tree(tree, vertex_values):
21+
nodes = {value: TreeNode(value) for value in vertex_values}
22+
for i, row in enumerate(tree):
23+
node = nodes[vertex_values[i]]
24+
for j, is_connected in enumerate(row):
25+
if j <= i:
26+
continue
27+
if is_connected:
28+
node.connected.append(nodes[vertex_values[j]])
29+
head = nodes[vertex_values[0]]
30+
return head`,
3731
},
3832
{
3933
id: 'TSFirstNode',

pages/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const languagesDropdown: LanguageOption[] = [
8080
];
8181

8282
const formats = [
83-
{ name: 'Auto-detect', id: 'auto' },
83+
{ name: 'Auto-detect', id: 'Auto-detect' },
8484
{ name: 'JSDoc', id: 'JSDoc' },
8585
{ name: 'reST', id: 'reST' },
8686
{ name: 'Google', id: 'Google' },
@@ -154,7 +154,7 @@ export default function Example() {
154154
languageId: selectedLanguage.id,
155155
commented: commentsEnabled,
156156
userId: fingerprintID || 'web',
157-
docStyle: 'Auto-generate',
157+
docStyle: selectedFormat.id,
158158
context: code,
159159
source: 'web',
160160
});

0 commit comments

Comments
 (0)