@@ -43,6 +43,7 @@ pub fn get_problem(frontend_question_id: u32) -> Option<Problem> {
43
43
sample_test_case : resp. data . question . sample_test_case ,
44
44
difficulty : problem. difficulty . to_string ( ) ,
45
45
question_id : problem. stat . frontend_question_id ,
46
+ return_type : serde_json:: from_str ( & resp. data . question . meta_data . return_info . type_name ) . unwrap ( ) ,
46
47
} ) ;
47
48
}
48
49
}
@@ -64,6 +65,7 @@ pub struct Problem {
64
65
pub sample_test_case : String ,
65
66
pub difficulty : String ,
66
67
pub question_id : u32 ,
68
+ pub return_type : String ,
67
69
}
68
70
69
71
#[ derive( Serialize , Deserialize ) ]
@@ -111,7 +113,21 @@ struct Question {
111
113
#[ serde( rename = "sampleTestCase" ) ]
112
114
sample_test_case : String ,
113
115
#[ serde( rename = "metaData" ) ]
114
- meta_data : String ,
116
+ meta_data : MetaData ,
117
+ }
118
+
119
+ #[ derive( Debug , Serialize , Deserialize ) ]
120
+ struct MetaData {
121
+ name : String ,
122
+ params : String ,
123
+ return_info : ReturnInfo ,
124
+ }
125
+
126
+ #[ derive( Debug , Serialize , Deserialize ) ]
127
+ struct ReturnInfo {
128
+ #[ serde( rename = "type" ) ]
129
+ type_name : String ,
130
+ params : String ,
115
131
}
116
132
117
133
#[ derive( Debug , Serialize , Deserialize ) ]
0 commit comments