Added stackoverflow various implementations in analyzing which is fastest.