refactor: define combined ContestID and Index to reduce declarations

This commit is contained in:
Muhammad Nauman Raza 2025-01-25 23:59:18 +00:00
parent 5aa133b6af
commit 8f4d2cb946
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -75,8 +75,9 @@ func main() {
for _, p := range response.Result.Problems { for _, p := range response.Result.Problems {
for _, i := range files { for _, i := range files {
if i == fmt.Sprintf("%v%v", p.ContestId, p.Index) { combined := fmt.Sprintf("%v%v", p.ContestId, p.Index)
text := fmt.Sprintf("- [%v%v %v](https://codeforces.com/problemset/problem/%v/%v)", p.ContestId, p.Index, p.Name, p.ContestId, p.Index) if i == combined {
text := fmt.Sprintf("- [%v %v](https://codeforces.com/problemset/problem/%v/%v)", combined, p.Name, p.ContestId, p.Index)
solved = append(solved, text) solved = append(solved, text)
continue continue
} }