Convert Date String to YYYY-MM-DD in Python

Day 7/100 ✅ Today's LeetCode problem — Convert Date String to YYYY-MM-DD format 📅 Input: "20th Oct 2052" Output: "2052-10-20" Approach: → Split the string into day, month, year → Strip the suffix (st, nd, rd, th) using isdigit() → Map month name to number using dictionary → Add leading zero with zfill(2) Simple problem but great practice for string manipulation in Python. 🐍 #100DaysOfLeetCode #LeetCode #Python #StringManipulation #DSA #100DaysOfCode

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories