How to deny Share access for site members in SharePoint Online

I was asked, if there is a way to disable SHARE button for users with Contribute / Edit access in SharePoint. I did notice blogs talking about using code to hide SHARE button from SharePoint Ribbon and I was sure I can deny access using OOB way with Permission level and fortunately had enough time to blog my finding which might…