전체 글15 Flutter 프레임워크의 Architecture에 대해 알아보자 - 공식 문서 정리 공식 문서를 정리 Notion 페이지에서도 볼 수 있음 Architectural layers Flutter는 확장가능하고 layered된 시스템으로 디자인됨 underlying layer에 의존하는 독립적인 라이브러리들의 series로 존재함 어떤 layer도 하위 layer에게 엑세스 특권을 가지고 있지 않다 framework 레벨의 모든 part는 optional하고 replaceable하다. underlying operation system에 대해, Flutter application은 다른 native application과 같은 방식으로 package 되어있음. platform-specific embedder의 역할은 다음과 같다: entrypoint를 제공 rendering surfaces, .. 2022. 7. 25. [LeetCode with Python] 51. N-Queens Difficulty : Hard Approach : Use backtrack like in '52. N-Queens II'. Deliever placement information to next level in backtracking. from typing import List visited = [] answers = [] def make_visited_from(row: int, col: int, n: int) -> None: visited[row][col] = 1 left_row = row + 1 left_col = col - 1 right_row = row + 1 right_col = col + 1 down_row = row + 1 while left_row < n and 0 2020. 7. 14. [LeetCode with Python] 52. N-Queens II Difficulty : Hard Approach : Use backtracking and suppose 'row' as each backtracking level. total_count = 0 visited = [] def make_visited_from(row: int, col: int, n: int) -> None: visited[row][col] = 1 left_row = row + 1 left_col = col - 1 right_row = row + 1 right_col = col + 1 down_row = row + 1 while left_row < n and 0 2020. 7. 13. [LeetCode with Python] 389. Find the Difference Difficulty : Easy Approach : use alphabet map and save each letter's count. And compare class Solution: def findTheDifference(self, s: str, t: str) -> str: answer = "" s_dict = {} t_dict = {} for i in range(97, 123): s_dict[chr(i)] = 0 t_dict[chr(i)] = 0 for letter in s: s_dict[letter] += 1 for letter in t: t_dict[letter] += 1 for letter in s_dict: if s_dict[letter] != t_dict[letter]: answer.. 2020. 7. 12. [LeetCode with Python] 690. Employee Importance Difficulty : Easy Approach : use BFS and search from given id until reaching the most subordinates. """ # Definition for Employee. class Employee: def __init__(self, id: int, importance: int, subordinates: List[int]): self.id = id self.importance = importance self.subordinates = subordinates """ from collections import deque adjacent_list = {} value_map = {} total_importance = 0 def bfs(id): glo.. 2020. 7. 12. [LeetCode with Python] 1046. Last Stone Weight Difficulty : Easy 1st Approach : sort and erase one by one(suceeded but too slow) from typing import List class Solution: def lastStoneWeight(self, stones: List[int]) -> int: stones.sort(reverse=True) while len(stones) >= 2: #print(stones) first = stones.pop(0) second = stones.pop(0) diff = first - second if diff: diff_i = 0 for i in range(len(stones)): if diff >= stones[i]: diff_i = i break if .. 2020. 7. 8. [LeetCode with Python] 84. Largest Rectangle in Histogram Difficulty : Hard 1st Approash : 2D array DP -> Memory Limit Exceeded! from typing import List class Solution: def largestRectangleArea(self, heights: List[int]) -> int: N = len(heights) if N == 0: return 0 mat = [[0] * N for _ in range(N)] for i in range(N): mat[i][i] = heights[i] for ran_num in range(1, N): for i in range(0, N - ran_num): j = i + ran_num min_height = 100000000000 for k in rang.. 2020. 7. 7. [LeetCode with Python] 304. Range Sum Query 2D - Immutable Difficulty : Medium 1st Approach : use sement tree -> too slow from typing import List class NumMatrix: def __init__(self, matrix: List[List[int]]): self.matrix = matrix self.row_M = len(matrix) self.col_N = len(matrix[0]) if matrix else 0 self.tree = [[0] * (self.col_N * 4) for _ in range(self.row_M)] for i in range(self.row_M): self.init_tree(i) def init_tree(self, row: int) -> None: for key, .. 2020. 7. 6. 이전 1 2 다음