Add URL question links to ID/Title, url property

This commit is contained in:
2023-10-08 19:41:37 -05:00
parent 7bd0026b37
commit f4f8872c96
2 changed files with 10 additions and 3 deletions

View File

@@ -39,6 +39,13 @@ class Question(BaseModel):
difficulty: str
tags: List[Tag]
@property
def url(self) -> str:
"""
Gets the URL to the question.
"""
return f"https://leetcode.com/problems/{self.slug}"
class QuestionDatabase(object):
"""