Elfsong commited on
Commit
41302a5
·
1 Parent(s): 7368e62
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  import random
2
  import pandas as pd
3
  import streamlit as st
@@ -22,10 +28,11 @@ if "problem" in st.query_params:
22
  st.markdown(problem_instance["question_content"])
23
 
24
  with st.expander("Test Cases"):
 
25
  df = pd.DataFrame(
26
  {
27
- "input": [problem['input'] for problem in problem_instance["test_cases"]],
28
- "output": [problem['output'] for problem in problem_instance["test_cases"]],
29
  }
30
  )
31
  st.dataframe(
 
1
+ # coding: utf-8
2
+
3
+ # Author: Du Mingzhe (mingzhe@nus.edu.sg)
4
+ # Date: 2025-04-01
5
+
6
+ import json
7
  import random
8
  import pandas as pd
9
  import streamlit as st
 
28
  st.markdown(problem_instance["question_content"])
29
 
30
  with st.expander("Test Cases"):
31
+ test_cases = json.loads(problem_instance["test_cases"])
32
  df = pd.DataFrame(
33
  {
34
+ "input": [test_case['input'] for test_case in test_cases],
35
+ "output": [test_case['output'] for test_case in test_cases],
36
  }
37
  )
38
  st.dataframe(