Skip to content

Commit 8ee1f58

Browse files
committed
Update README with latest problem counts and progress percentages
1 parent 8629316 commit 8ee1f58

2 files changed

Lines changed: 34 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 🏆 Problem Solving Statistics
44

55
[![Last Updated](https://img.shields.io/badge/Last%20Updated-15%20January%202026-blue?style=for-the-badge)](https://github.com/MishkatIT/ProblemSolvingStats)
6-
[![Total Problems](https://img.shields.io/badge/Total%20Solved-3526-success?style=for-the-badge&logo=leetcode)](https://github.com/MishkatIT/ProblemSolvingStats)
6+
[![Total Problems](https://img.shields.io/badge/Total%20Solved-3646-success?style=for-the-badge&logo=leetcode)](https://github.com/MishkatIT/ProblemSolvingStats)
77
[![Platforms](https://img.shields.io/badge/Platforms-12-orange?style=for-the-badge)](https://github.com/MishkatIT/ProblemSolvingStats)
88

99
<!-- UPDATE_METADATA_START -->
@@ -36,31 +36,31 @@
3636
<td><strong>🔴 Codeforces</strong></td>
3737
<td><a href="https://codeforces.com/profile/MishkatIT">MishkatIT</a></td>
3838
<td align="center"><strong>2386</strong></td>
39-
<td><img src="https://img.shields.io/badge/Progress-67.7%25-red?style=flat-square" alt="Codeforces Progress"/></td>
39+
<td><img src="https://img.shields.io/badge/Progress-65.4%25-red?style=flat-square" alt="Codeforces Progress"/></td>
4040
</tr>
4141
<tr>
4242
<td><strong>🟢 LeetCode</strong></td>
4343
<td><a href="https://leetcode.com/MishkatIT/">MishkatIT</a></td>
4444
<td align="center"><strong>412</strong></td>
45-
<td><img src="https://img.shields.io/badge/Progress-11.7%25-yellow?style=flat-square" alt="LeetCode Progress"/></td>
45+
<td><img src="https://img.shields.io/badge/Progress-11.3%25-yellow?style=flat-square" alt="LeetCode Progress"/></td>
4646
</tr>
4747
<tr>
4848
<td><strong>🟣 Vjudge</strong></td>
4949
<td><a href="https://vjudge.net/user/MishkatIT">MishkatIT</a></td>
5050
<td align="center"><strong>400</strong></td>
51-
<td><img src="https://img.shields.io/badge/Progress-11.3%25-blueviolet?style=flat-square" alt="Vjudge Progress"/></td>
51+
<td><img src="https://img.shields.io/badge/Progress-11.0%25-blueviolet?style=flat-square" alt="Vjudge Progress"/></td>
5252
</tr>
5353
<tr>
5454
<td><strong>🟠 AtCoder</strong></td>
5555
<td><a href="https://atcoder.jp/users/MishkatIT">MishkatIT</a></td>
5656
<td align="center"><strong>158 <br/><small>(last updated: unknown)</small></strong></td>
57-
<td><img src="https://img.shields.io/badge/Progress-4.5%25-orange?style=flat-square" alt="AtCoder Progress"/></td>
57+
<td><img src="https://img.shields.io/badge/Progress-4.3%25-orange?style=flat-square" alt="AtCoder Progress"/></td>
5858
</tr>
5959
<tr>
6060
<td><strong>🟤 CodeChef</strong></td>
6161
<td><a href="https://www.codechef.com/users/MishkatIT">MishkatIT</a></td>
62-
<td align="center"><strong>3</strong></td>
63-
<td><img src="https://img.shields.io/badge/Progress-0.1%25-brown?style=flat-square" alt="CodeChef Progress"/></td>
62+
<td align="center"><strong>123</strong></td>
63+
<td><img src="https://img.shields.io/badge/Progress-3.4%25-brown?style=flat-square" alt="CodeChef Progress"/></td>
6464
</tr>
6565
<tr>
6666
<td><strong>⚪ CSES</strong></td>
@@ -108,7 +108,7 @@
108108
<tfoot>
109109
<tr>
110110
<td colspan="2" align="center"><strong>🎖️ TOTAL</strong></td>
111-
<td align="center"><strong style="font-size: 1.2em;">3526</strong></td>
111+
<td align="center"><strong style="font-size: 1.2em;">3646</strong></td>
112112
<td align="center"><strong>100%</strong></td>
113113
</tr>
114114
</tfoot>

‎update_stats.py‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,31 @@ def get_codechef(self):
263263
url = "https://www.codechef.com/users/MishkatIT"
264264
html = self.fetch_url(url)
265265
if html:
266+
# Prefer the explicit summary line many profiles include:
267+
# e.g. "Total Problems Solved: 123"
268+
explicit_patterns = [
269+
r'Total\s+Problems\s+Solved\s*:\s*(\d+)',
270+
r'Total\s+Problems\s+Solved\s*</[^>]+>\s*(\d+)',
271+
]
272+
273+
# Search raw HTML first
274+
for pattern in explicit_patterns:
275+
match = re.search(pattern, html, re.IGNORECASE | re.DOTALL)
276+
if match:
277+
count = int(match.group(1))
278+
if 0 <= count < self.MAX_REASONABLE_COUNT:
279+
return count
280+
281+
# Then search a tag-stripped version to handle HTML elements between words
282+
text_only = re.sub(r'<[^>]+>', ' ', html)
283+
text_only = re.sub(r'\s+', ' ', text_only)
284+
for pattern in explicit_patterns:
285+
match = re.search(pattern, text_only, re.IGNORECASE)
286+
if match:
287+
count = int(match.group(1))
288+
if 0 <= count < self.MAX_REASONABLE_COUNT:
289+
return count
290+
266291
# Try multiple patterns to extract the problem count
267292
patterns = [
268293
# CodeChef specific patterns
@@ -284,7 +309,7 @@ def get_codechef(self):
284309
if match:
285310
count = int(match.group(1))
286311
# Sanity check - CodeChef count should be reasonable
287-
if 0 < count < self.MAX_REASONABLE_COUNT:
312+
if 0 <= count < self.MAX_REASONABLE_COUNT:
288313
return count
289314

290315
# If no pattern matched, log for debugging

0 commit comments

Comments
 (0)