How to declare and initialize a set containing unique objects in Ruby

1 Answer

0 votes
require 'set'

st = Set.new [8, 4, 1, 0, 5, 3, 7]

print st




#
# run:
# 
# #<Set: {8, 4, 1, 0, 5, 3, 7}>
# 

 



answered Mar 11, 2023 by avibootz

Related questions

...