Sort:  

the similar content is written by me in another platform and ported here. I have referenced it on top