Created
August 31, 2023 03:15
-
-
Save dnovais/e762b6e8c25d9a0ed53e7845ced1af57 to your computer and use it in GitHub Desktop.
Simple Search Algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list = [1, 2, 3, 4, 5, 6, 7, 30, 32, 12, 21, 22, 56, 70, 62] | |
list = list.sort | |
find = 21 | |
list.each do |item| | |
puts "The number #{find} is here!" if item == find | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment