Skip to content

Latest commit

 

History

History
 
 

726.Number-of-Atoms

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

726.Number-of-Atoms

典型的栈的应用。此题的特别之处在于stack的元素应该是map<string,int>.

遍历formula的元素,分别对formula[i]=='(', ')', '大写字母'三种情况进行讨论。注意分子式中的下标数字为1时会缺省。

Leetcode Link