https://github.com/sofakingworld/nmax
funbox qualification test
https://github.com/sofakingworld/nmax
Last synced: 27 days ago
JSON representation
funbox qualification test
- Host: GitHub
- URL: https://github.com/sofakingworld/nmax
- Owner: sofakingworld
- License: mit
- Created: 2017-10-20T13:08:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-24T23:19:23.000Z (over 8 years ago)
- Last Synced: 2025-01-14T12:17:01.380Z (over 1 year ago)
- Language: Ruby
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://travis-ci.org/SofaKing18/nmax)
=======
# Nmax
This gem returns N maximum integers from input string or stdin
number is a sequence from 1 to 1000 digits
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'nmax'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install nmax
## Usage
ruby
```ruby
require 'nmax'
obj = Nmax::STDReader.new(3) # return 3 max numbers
obj.get_numbers('a33b42c31f-3-4')
obj.max_numbers # => [31, 33, 42]
```
or in console
```bash
cat Example_file.txt | nmax 30
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/SofaKing18/nmax.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).