본문 바로가기

Codility4

Codility : GenomicRangeQuery 풀이 문제 GenomicRangeQuery coding task - Learn to Code - Codility Find the minimal nucleotide from a range of sequence DNA. app.codility.com A DNA sequence can be represented as a string consisting of the letters A, C, G and T, which correspond to the types of successive nucleotides in the sequence. Each nucleotide has an impact factor, which is an integer. Nucleotides of types A, C, G and T have impa.. 2022. 3. 5.
Codility : MaxSliceSum 풀이 Java, DP 문제 MaxSliceSum coding task - Learn to Code - Codility Find a maximum sum of a compact subsequence of array elements. app.codility.com A non-empty array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P ≤ Q < N, is called a slice of array A. The sum of a slice (P, Q) is the total of A[P] + A[P+1] + ... + A[Q]. Write a function: class Solution { public int solution(in.. 2022. 3. 5.
Codility : Greedy MaxNonoverlappingSegments 풀이 Java, Greedy 알고리즘 문제 MaxNonoverlappingSegments coding task - Learn to Code - Codility Find a maximal set of non-overlapping segments. app.codility.com Located on a line are N segments, numbered from 0 to N − 1, whose positions are given in arrays A and B. For each I (0 ≤ I < N) the position of segment I is from A[I] to B[I] (inclusive). The segments are sorted by their ends, which means that B[K] ≤ B[K + 1] for K.. 2022. 3. 4.
Codility : Leader Dominator 풀이 Java, HashMap entrySet 문제 Dominator coding task - Learn to Code - Codility Find an index of an array such that its value occurs at more than half of indices in the array. app.codility.com An array A consisting of N integers is given. The dominator of array A is the value that occurs in more than half of the elements of A. For example, consider array A such that A[0] = 3 A[1] = 4 A[2] = 3 A[3] = 2 A[4] = 3 A[5] = -1 A[.. 2022. 3. 3.
반응형