I am using drop down where the li elements are on the right side. I want the last menu's li elements to be on the left so that it doesn't get hidden. Kindly help. Screenshot attached.
What menu system are you using, a custom coded one or an off the shelf one, such as Bootstrap? Might be better to post a url to the page in question so someone can determine the best approach taking into account what code you currently are deploying.
I'd read the OPs post more carefully if I were you as that example does nothing to help except place a drop down to the extreme left and extreme right of the window, not what is required by the OP.
Let me explain. The OP has a second tier menu which opens to the right of the first level dropdown and of course that will disappear off the extreme right edge of the browser window which is why they want it to open to the left so it stays within the bounds of the window, whilst I assume they require the other second tier menus to open to the right of the first level dropdowns as they have space to do so.
Either do it with javascript by detecting when the last menu is offscreen and then placing it to the left or probably simpler to do it with css. This kind of menu is troublesome and should really be avoided and replaced by something simpler.