Search
⌘K

Leetcode 388. Longest Absolute File Path

Given a string using '\n' and '\t' to represent a nested filesystem, compute the length of the longest absolute path to any file. The core challenge is parsing each line to determine its depth from leading tabs and maintaining cumulative path lengths by depth (e.g., with a stack/array) to update the maximum when a file is encountered.

Asked at:

Datadog


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late January, 2025

Datadog

Senior

Comments

Your account is free and you can post anonymously if you choose.