[Python] json의 key, value에 따른 데이터 추출
json에서 key값이 실제 값인 경우 user_list = { "user1": { "key1" : "Y", "key2" : "Y" }, "user2": { "key1" : "N", "key2" : "Y" }, "user3": { "key1" : "N", "key2" : "N" } } key만 필요한 경우 list = data.keys() # dict_keys(["user1","user2","user3"]) list = [user for user in data] # ["user1","user2","user3"] value만 필요한 경우 list = [data.get(user) for user in data] ''' [ { "key1" : "Y", "key2" : "Y" }, { "key1" : "N", ..
2023. 3. 10.
[LeetCode] 64. Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Example 1: Input: grid = [[1,3,1],[1,5,1],[4,2,1]] Output: 7 Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum. Example 2: Input: grid = [[1,2,3],[4,5,6]] Output: 1..
2022. 8. 17.