{ "topic": "roman-binary", "input_types": [ "text" ], "input_labels": [ "Roman" ], "input_values": [ "CXVII" ], "type": "Convert", "title": "Roman to Binary", "category": "Numbers", "function": "function myFunc(arr) {\n let x = arr[0];\n const rNs = {'I': 1,'V': 5,'X': 10,'L': 50,'C': 100,'D': 500,'M': 1000};\n let result = 0;\n for (let i = 0; i < x.length; i++) {\n let csv = rNs[x[i]];\n let nsv = rNs[x[i + 1]];\n if (nsv > csv) {\n result += (nsv - csv);\n i++;\n } else {\n result += csv;\n }\n }\n return result.toString(2);\n }", "op_label": "Binary", "explanation": "This converter converts the given roman number to binary number." }