Added 2nd task.
Added 2nd part.
Handle negative numbers.
Added alternative versions.
Added safe version.
Added Map version.
Added Map and pointfree version.