Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 470 Bytes

README.md

File metadata and controls

13 lines (9 loc) · 470 Bytes

balance both sides

task

Each exclamation mark weight is 2; Each question mark weight is 3. Put two string left and right to the balance, Are they balanced?

If the left side is more heavy, return "Left"; If the right side is more heavy, return "Right"; If they are balanced, return "Balance".

Examples balance("!!","??") === "Right" balance("!??","?!!") === "Left" balance("!?!!","?!?") === "Left" balance("!!???!????","??!!?!!!!!!!") === "Balance"