An open API service indexing awesome lists of open source software.

https://github.com/rggh/missing_gap

Artihmetic Progression
https://github.com/rggh/missing_gap

arithmetic-progression closure rust

Last synced: 8 months ago
JSON representation

Artihmetic Progression

Awesome Lists containing this project

README

          

[![Rust](https://github.com/RGGH/missing_gap/actions/workflows/rust.yml/badge.svg)](https://github.com/RGGH/missing_gap/actions/workflows/rust.yml)

# Use closure in a function

* iterate from 1..seq.len()
* use hashmap to find number(gap) that occurs just once

we could use 3 functions ideally - but for codewars it was simpler to make 1 function and use a closure
plus I wanted to practice using closures more!