8000 code snippet property" · Coderbeep/LeetCode-CLI@35896c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 35896c2

Browse files
committed
code snippet property"
1 parent dce36b1 commit 35896c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

leetcode/models/graphql_get_question_detail.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ def content(self):
4343
@property
4444
def sample_test_case(self):
4545
return self._question_data.get('sampleTestCase')
46+
47+
@property
48+
def code_snippet(self, lang: str = 'python3'):
49+
return list(filter(lambda x: x['langSlug'] == lang, self._question_data.get('codeSnippets')))[0].get('code')

0 commit comments

Comments
 (0)
0