FazeelUsmani / Amazon-SDE-Preparation

This repository includes all the interview preparation questions for Amazon SDE role
https://practice.geeksforgeeks.org/batch/Amazon-Test-Series
1.15k stars 295 forks source link

Create 04 romanNumberToInteger.cpp #78

Closed Juro221 closed 3 years ago

Juro221 commented 3 years ago

We create a map. Then we iterate through our roman word and we construct our decimal number. Looking into map takes log n time but since we are using map of only 7 entries, the time for using a map should be constant. Then our time complexity of whole program should be O(|S|).

Juro221 commented 3 years ago

The program works fine for me, no compilation error. Error might be caused by using older version of GCC. https://gcc.gnu.org/onlinedocs/gcc-5.2.0/libstdc++/manual/manual/using_dual_abi.html