https://github.com/mxssl/leetcodereverseintegergolang
https://github.com/mxssl/leetcodereverseintegergolang
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mxssl/leetcodereverseintegergolang
- Owner: mxssl
- Created: 2018-09-03T20:25:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T20:29:14.000Z (almost 8 years ago)
- Last Synced: 2025-01-22T19:21:30.495Z (over 1 year ago)
- Language: Go
- Size: 0 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reverse Integer
Given a 32-bit signed integer, reverse digits of an integer.
`Time Complexity: O(log(x))`
`Space Complexity: O(1)`
```Bash
$ go test -v -cover ./...
=== RUN TestCase1
Expected: 654321, Output: 654321
--- PASS: TestCase1 (0.00s)
=== RUN TestCase2
Expected: -654321, Output: -654321
--- PASS: TestCase2 (0.00s)
=== RUN TestCase3
Expected: 0, Output: 0
--- PASS: TestCase3 (0.00s)
=== RUN TestCase4
Expected: 0, Output: 0
--- PASS: TestCase4 (0.00s)
PASS
coverage: 87.5% of statements
ok github.com/mxssl/reverseInteger 0.148s coverage: 87.5% of statements
```