Andrew ⚛️ & ☕ Posted on Sep 1, 2020 Find the smallest integer in the array with Ruby #ruby #rails #100daysofcode #codenewbie Top comments (4) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand Steve Alex Steve Alex Steve Alex Follow Aircraft Mechanic, Aeronautical Engineer, Navigator, Systems Analyst, IT manager, Golfer that writes code for pleasure! Location Gadsden Alabama Work Retired Software Geek at Wherever and whenever I want Joined Aug 15, 2020 • Sep 2 '20 Dropdown menu Copy link Hide Whats wrong with a = [-1,1,4,5,6,9] irb(main):005:0> a.min => -1 Collapse Expand Andrew ⚛️ & ☕ Andrew ⚛️ & ☕ Andrew ⚛️ & ☕ Follow Location Europe Joined Aug 31, 2019 • Sep 2 '20 • Edited on Sep 2 • Edited Dropdown menu Copy link Hide Hi Steve! In solution #2 I use a.min def find_smallest_int(arr) arr.min end And in my opinion, this is the best one. You can see all of my solutions here: losseff.xyz/katas/008-find-the-sma... Collapse Expand Steve Alex Steve Alex Steve Alex Follow Aircraft Mechanic, Aeronautical Engineer, Navigator, Systems Analyst, IT manager, Golfer that writes code for pleasure! Location Gadsden Alabama Work Retired Software Geek at Wherever and whenever I want Joined Aug 15, 2020 • Sep 2 '20 Dropdown menu Copy link Hide Sorry, I didn't see that one - screen too small. I just heard a couple loop solutions. Andrew ⚛️ & ☕ Andrew ⚛️ & ☕ Andrew ⚛️ & ☕ Follow Location Europe Joined Aug 31, 2019 • Sep 2 '20 Dropdown menu Copy link Hide 👍 Thanks for the feedback! I'll use bigger font size and will give more info about all approaches before writing the code. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
Top comments (4)
Whats wrong with
a = [-1,1,4,5,6,9]
irb(main):005:0> a.min
=> -1
Hi Steve!
In solution #2 I use a.min
And in my opinion, this is the best one.
You can see all of my solutions here: losseff.xyz/katas/008-find-the-sma...
Sorry, I didn't see that one - screen too small. I just heard a couple loop solutions.
👍
Thanks for the feedback!
I'll use bigger font size and will give more info about all approaches before writing the code.