js:(
# Rearrange Spaces Between Words (LeetCode 1592) ## Goal Redistribute spaces evenly between words, extra at the end. ## Approach Count spaces and words; gap = spaces // (words-1), handle the single-word case. ## Tip Single-word input is the edge case to call out. Prep notes shared by the Linkjob AI team. Practice explaining solutions out loud with [this tool](https://www.linkjob.ai/).