You are viewing a single comment's thread. Return to all comments →
Try this-
hackerrank.store(543121, 100)
hackerrank.keep_if { |key, value| key.is_a?(Integer) }
hackerrank.delete_if { |key, value| key.even? }
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby Hash - Addition, Deletion, Selection
You are viewing a single comment's thread. Return to all comments →
Try this-
hackerrank.store(543121, 100)
hackerrank.keep_if { |key, value| key.is_a?(Integer) }
hackerrank.delete_if { |key, value| key.even? }