diff --git a/Contributors.md b/Contributors.md index 7684c46..0abe511 100644 --- a/Contributors.md +++ b/Contributors.md @@ -24,3 +24,5 @@ Welcome to the list of people who contributed to this repo 💥 7. [Ayansh](https://github.com/badasschef) 8. [Deep](https://github.com/deep846) 9. [Amit](https://github.com/amitShindeGit) +10. [Pulkit](https://github.com/practicalmetal) + 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