NeetCode #381LC-726HardStack
← Back to All Problems#381 · #726 · Number of Atoms(原子的数量)
📌 Problem Statement & Constraints
Given a chemical
formula, return the count of each atom as a string in the form Name followed by its count (omitted when the count is 1), with names sorted alphabetically. Atoms start with an uppercase letter and may continue with lowercase letters; parentheses may be nested and followed by a multiplier. Constraints: 1 <= formula.length <= 1000.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!