leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

Bug Report for crawler-log-folder

Open Aditya-1301 opened this issue 2 months ago • 0 comments

Bug Report for https://neetcode.io/problems/crawler-log-folder

My solution was:

class Solution:
    def minOperations(self, logs: List[str]) -> int:
        def distance(logs=[], dist=0):
            if len(logs) == 0:
                return dist
            pattern_1 = r'[a-z](\d+)/'
            match_1 = re.match(pattern_1, logs[0])
            if match_1:
                dist += 1
            elif logs[0] == "../":
                dist -= 1
            elif logs[0] == "./":
                pass
            return distance(logs[1:], dist)
        
        return max(0, distance(logs, 0))

And for the second use case, the expected output is wrong in the testing system:

Image

This is clearly wrong as the expected output for the test case is also shown to be 0 in the example for the question:

Image

Aditya-1301 avatar Sep 29 '25 19:09 Aditya-1301