분류 전체보기
-
[Python] List Comprehension to DictAlgorithm 2021. 8. 21. 11:41
list comprehenion 으로 dict 구조 만들기 #1 몸풀기 arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], ] squared_list = [[n ** 2 for n in row] for row in arr] print(squared_list) [[1, 4, 9], [16, 25, 36], [49, 64, 81], [100, 121, 144]] #2 본론 from string import ascii_lowercase as LOWERS dict_boy = {c: n for c, n in zip(LOWERS, range(1, 27))} print(dict_boy) {'a': 1, 'b': 2, 'c': 3, ..., 'x': 24, 'y': 25, ..
-
[LeetCode]#682. Baseball GameAlgorithm/LeetCode 2021. 8. 13. 16:19
Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character. Note that after backspacing an empty text, the text will continue empty. Example 1: Input: s = "ab#c", t = "ad#c" Output: true Explanation: Both s and t become "ac". Example 2: Input: s = "ab##", t = "c#d#" Output: true Explanation: Both s and t become "". Exampl..
-
[Leetcode] 844. Backspace String CompareAlgorithm/LeetCode 2021. 8. 13. 15:06
844. Backspace String Compare Easy 2788126Add to ListShare Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character. Note that after backspacing an empty text, the text will continue empty. Example 1: Input: s = "ab#c", t = "ad#c" Output: true Explanation: Both s and t become "ac". Example 2: Input: s = "ab##", t = "c#d..
-
[Leetcode] 1598. Crawler Log FolderAlgorithm/LeetCode 2021. 8. 13. 14:41
1598. Crawler Log Folder Easy 31225Add to ListShare The Leetcode file system keeps a log each time some user performs a change folder operation. The operations are described below: "../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder). "./" : Remain in the same folder. "x/" : Move to the child folder named x (This folder is gu..