From 9908a3dc24b441ecb27419fd345e0960e45c7f5d Mon Sep 17 00:00:00 2001 From: Lam Haoyin Date: Mon, 14 Mar 2022 18:08:34 +0800 Subject: [PATCH] add: 220314 [cpp] --- cpp/2203/220314.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cpp/2203/220314.cpp diff --git a/cpp/2203/220314.cpp b/cpp/2203/220314.cpp new file mode 100644 index 0000000..190db07 --- /dev/null +++ b/cpp/2203/220314.cpp @@ -0,0 +1,16 @@ +/** + * 71. Simplify Path + * Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path. + * + * In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names. + * + * The canonical path should have the following format: + * + * The path starts with a single slash '/'. + * Any two directories are separated by a single slash '/'. + * The path does not end with a trailing '/'. + * The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period '.' or double period '..') + * Return the simplified canonical path. + * + * Refer: 220106-CN.cpp + */ \ No newline at end of file