prefix2 [Python] 5.3. MinAvgTwoSlice https://app.codility.com/programmers/lessons/5-prefix_sums/ 5. Prefix Sums lesson - Learn to Code - Codility Compute number of integers divisible by k in range [a..b]. app.codility.com 1차 시도 Task Score 50% Correctness 100% Performance 0% 시간복잡도 O(N ** 3) def solution(A): N = len(A) prefix_sum = [A.copy() for _ in range(N)] min_val = 10 ** 10 answer = N for p in range(N): for q in range(p+1,N): if.. 2021. 3. 18. [Python] 5.2. GenomicRangeQuery app.codility.com/programmers/lessons/5-prefix_sums/ 5. Prefix Sums lesson - Learn to Code - Codility Compute number of integers divisible by k in range [a..b]. app.codility.com 1차 시도 Task Score 62% Correctness 100% Performance 0% 시간복잡도 O(N*M) def solution(S, P, Q): impact_factor = {"A":1,"C":2,"G":3,"T":4} lst = [] for K in range(len(P)): queries = set(S[P[K]:Q[K]+1]) min_val = 9 for q in querie.. 2021. 3. 16. 이전 1 다음 728x90 반응형