LeetCode
Number of Atoms
Click
here
for an explanation.