Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

Implement a hierarchical key-value store where each path follows a directory-like structure (e.g., /a/b/c). The store begins with a root path /, which always exists with a string value "root". Operations include creating paths under existing parents, setting values on existing paths, retrieving values, and deleting leaf paths only (except the root).

Implement the PathKeyValueStore with the specified behaviors:

Test Cases
Input
Output
Expected