더 많은 포스팅 보기 자세히보기

codility 6

[codility] lessons 2 OddOccurrencesInArray

OddOccurrencesInArray 출처: https://app.codility.com/programmers/lessons 문제 설명 A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired. For example, in array A such that: A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5]..

[codility] lessons 4 MaxCounters

MaxCounters 출처: https://app.codility.com/programmers/lessons 문제 설명 You are given N counters, initially set to 0, and you have two possible operations on them: increase(X) − counter X is increased by 1, max counter − all counters are set to the maximum value of any counter. A non-empty array A of M integers is given. This array represents consecutive operations: if A[K] = X, such that 1 ≤ X ≤ N, ..

반응형