Singh algorithm

Description
has function