Hash#size() is a Hash class method which returns the count of key-value pair in the hash.
Parameter: Hash values
Return: count of key-value pair in the hash.
Example #1 :
Hash a size form : 2 Hash b size form : 3 Hash c size form : 1
Example #2 :
Hash a size form : 2 Hash b size form : 1 Hash c size form : 3
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.