Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 361 Bytes

8 kyu - Find the smallest integer in the array.md

File metadata and controls

15 lines (12 loc) · 361 Bytes

Task

Given an array of integers your solution should find the smallest integer.

For example:

Given [34, 15, 88, 2] your solution will return 2 Given [34, -345, -1, 100] your solution will return -345 You can assume, for the purpose of this kata, that the supplied array will not be empty.

My solution

def find_smallest_int(arr)
  arr.min
end