Converting Roman Numerals to Integers in Java

100 Days of Coding Challenge – Day 16 📌 Problem: Roman to Integer 💻 Language: Java 🧠 Concept Used: HashMap + Conditional Traversal 🔍 Platform: LeetCode Today’s challenge was converting a Roman numeral into its integer representation. Approach: ✔ Stored Roman symbols and values in a HashMap ✔ Traversed the string from left to right ✔ If the current value is smaller than the next → subtract ✔ Otherwise → add Time Complexity: O(n) Space Complexity: O(1) 🔗 Problem Link: https://lnkd.in/g2YTaPrG 🔗 Code: https://lnkd.in/g7e_Y7V7 #100DaysOfCode #Day16 #Java #DSA #LeetCode #Strings #ProblemSolving #CodingJourney

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories