-
Notifications
You must be signed in to change notification settings - Fork 3
/
problem.go
62 lines (55 loc) · 1.81 KB
/
problem.go
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package leetgode
type Stat struct {
QuestionID int `json:"question_id"`
QuestionArticleLive interface{} `json:"question__article__live"`
QuestionArticleSlug interface{} `json:"question__article__slug"`
QuestionTitle string `json:"question__title"`
QuestionTitleSlug string `json:"question__title_slug"`
QuestionHide bool `json:"question__hide"`
TotalAcs int `json:"total_acs"`
TotalSubmitted int `json:"total_submitted"`
FrontendQuestionID int `json:"frontend_question_id"`
IsNewQuestion bool `json:"is_new_question"`
}
type Level int
func (l Level) String() string {
switch l {
case Easy:
return "Easy"
case Medium:
return "Medium"
case Hard:
return "Hard"
default:
return "Unknown"
}
}
const (
Easy Level = 1
Medium = 2
Hard = 3
)
type Difficulty struct {
Level Level `json:"level"`
}
type StatStatusPair struct {
Stat Stat `json:"stat"`
Status interface{} `json:"status"`
Difficulty Difficulty `json:"difficulty"`
PaidOnly bool `json:"paid_only"`
IsFavor bool `json:"is_favor"`
Frequency int `json:"frequency"`
Progress int `json:"progress"`
}
type ProblemsResult struct {
UserName string `json:"user_name"`
NumSolved int `json:"num_solved"`
NumTotal int `json:"num_total"`
AcEasy int `json:"ac_easy"`
AcMedium int `json:"ac_medium"`
AcHard int `json:"ac_hard"`
StatStatusPairs []*StatStatusPair `json:"stat_status_pairs"`
FrequencyHigh int `json:"frequency_high"`
FrequencyMid int `json:"frequency_mid"`
CategorySlug string `json:"category_slug"`
}