From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/roman_2_int.cpp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 other/roman_2_int.cpp (limited to 'other/roman_2_int.cpp') diff --git a/other/roman_2_int.cpp b/other/roman_2_int.cpp deleted file mode 100644 index 1389754..0000000 --- a/other/roman_2_int.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int romanToInt(string s) { - int ans = 0, num = 0; - for (int i = s.size() - 1; ~i; i--) { - switch (s[i]) { - case 'I': - num = 1; - break; - case 'V': - num = 5; - break; - case 'X': - num = 10; - break; - case 'L': - num = 50; - break; - case 'C': - num = 100; - break; - case 'D': - num = 500; - break; - case 'M': - num = 1000; - break; - } - if (4 * num < ans) - ans -= num; - else - ans += num; - } - return ans; - } -}; - -int main() { - Solution obj; - cout << obj.romanToInt("MCMXCIVMCMXCIV"); -} -- cgit v1.2.3