Solve Normalize File Path using Lua to enhance your skills with lua coding practice , master coding concepts, and prepare for interviews with practical exercises and detailed solutions.
Difficulty : Easy
Categories :
Given a string representing a file path in a file system, normalize the path according to these rules:
Note: You do not need to handle '..' (parent directory) components or validate the path.
Input: path = "//home/" Output: "/home" Explanation: Remove extra leading slash and trailing slash
Input: path = "/home//test/./file" Output: "/home/test/file" Explanation: Remove double slashes and '.' component
Real-World Applications Solve problems inspired by Lua's common use cases, such as game development and embedded systems.
Step-by-Step Guidance Break down Lua's concepts into digestible lessons.
Practical Skills Build hands-on experience with Lua for real-world projects.