https://github.com/mxssl/leetcoderomantointegergolang
Roman to Integer coverter in Go (Golang)
https://github.com/mxssl/leetcoderomantointegergolang
algorithm go golang
Last synced: 9 months ago
JSON representation
Roman to Integer coverter in Go (Golang)
- Host: GitHub
- URL: https://github.com/mxssl/leetcoderomantointegergolang
- Owner: mxssl
- Created: 2018-09-03T21:15:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T21:15:45.000Z (over 7 years ago)
- Last Synced: 2025-01-22T19:21:29.629Z (11 months ago)
- Topics: algorithm, go, golang
- Language: Go
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Roman to Integer
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Given a roman numeral, convert it to an integer.
`Time: O(n)`
`Space: O(1)`
```Bash
$ go test -v -cover ./...
=== RUN TestCase1
Expected: 3, Output: 3
--- PASS: TestCase1 (0.00s)
=== RUN TestCase2
Expected: 4, Output: 4
--- PASS: TestCase2 (0.00s)
=== RUN TestCase3
Expected: 9, Output: 9
--- PASS: TestCase3 (0.00s)
=== RUN TestCase4
Expected: 58, Output: 58
--- PASS: TestCase4 (0.00s)
PASS
coverage: 83.3% of statements
ok github.com/mxssl/LeetCodeRomanToIntegerGolang 0.093s coverage: 83.3% of statements
```