[LeetCode] Remove Sub-Folders from the Filesystem

1233. Remove Sub-Folders from the Filesystem

Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order.

If a folder[i] is located within another folder[j], it is called a sub-folder of it.

The format of a path is one or more concatenated strings of the form: ‘/‘ followed by one or more lowercase English letters.

  • For example, “/leetcode” and “/leetcode/problems” are valid paths while an empty string and “/“ are not.
Read more
[Codeforces] Round #728 (Div. 1) A. Great GraphsRead more
[Codeforces] Round #736 (Div. 1) A. Web of LiesRead more
[Hacker Rank] Chief HopperRead more
[Hacker Rank] Xor-sequenceRead more
[Hacker Rank] EqualRead more
[Hacker Rank] Gridland MetroRead more
[Hacker Rank] Fraudulent Activity NotificationsRead more
LeetCode Contest BiWeekly 80 & Weekly 297 후기

후기

Read more
[LeetCode] Naming a Company

2306. Naming a Company

You are given an array of strings ideas that represents a list of names to be used in the process of naming a company. The process of naming a company is as follows:

  1. Choose 2 distinct names from ideas, call them ideaA and ideaB.
  2. Swap the first letters of ideaA and ideaB with each other.
  3. If both of the new names are not found in the original ideas, then the name ideaA ideaB (the concatenation of ideaA and ideaB, separated by a space) is a valid company name.
  4. Otherwise, it is not a valid name.

Return the number of distinct valid names for the company.

Read more