From bb0420370c6083e4dd1d07a635fd520faf682e5a Mon Sep 17 00:00:00 2001 From: Pulkit Mittal <73461832+PracticalMetal@users.noreply.github.com> Date: Sat, 2 Oct 2021 00:19:41 +0530 Subject: [PATCH 1/2] Update Contributors.md --- Contributors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contributors.md b/Contributors.md index 50ce779..3057220 100644 --- a/Contributors.md +++ b/Contributors.md @@ -15,6 +15,6 @@ Welcome to the list of people who contributed to this repo 💥 2. [Gourav-78](https://github.com/Gourav-78) (Added Quick Sort Solution in C++) 3. [Anoushka-Ghosh](https://github.com/Anoushka-Ghosh) 4. [Shivanshi](https://github.com/shivanshi-s) -5. +5. [Pulkit](https://github.com/practicalmetal) 6. 7. From fc91cb2290cbac9c3d0031363c33b9a995ba38eb Mon Sep 17 00:00:00 2001 From: Pulkit Mittal <2pulkit2@gmail.com> Date: Sat, 2 Oct 2021 00:39:32 +0530 Subject: [PATCH 2/2] add math folder and solution for Roman to Integer --- .../Roman_To_Integer/CPP/Roman_To_Integer.cpp | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Math/Roman_To_Integer/CPP/Roman_To_Integer.cpp diff --git a/Math/Roman_To_Integer/CPP/Roman_To_Integer.cpp b/Math/Roman_To_Integer/CPP/Roman_To_Integer.cpp new file mode 100644 index 0000000..1504f6c --- /dev/null +++ b/Math/Roman_To_Integer/CPP/Roman_To_Integer.cpp @@ -0,0 +1,41 @@ +class Solution { +public: + int romanToInt(string s) { + int roman[256],sum=0; + roman['I']=1; + roman['V']=5; + roman['X']=10; + roman['L']=50; + roman['C']=100; + roman['D']=500; + roman['M']=1000; + + int i=0; + while(i