
11-1. CountNonDivisibleYou are given an array A consisting of N integers.For each number Ai such that 0 ≤ i < N, we want to count the number of ele

10-4. PeaksA non-empty array A consisting of N integers is given.A peak is an array element which is larger than its neighbors. More precisely, it is

10-3. FlagsA non-empty array A consisting of N integers is given.A peak is an array element which is larger than its neighbours. More precisely, it is

10-2. MinPerimeterRectangleAn integer N is given, representing the area of some rectangle.The area of a rectangle whose sides are of length A and B is

10-1. CountFactorsA positive integer D is a factor of a positive integer N if there exists an integer M such that N = D \* M.For example, 6 is a facto

9-3. MaxDoubleSliceSumA non-empty array A consisting of N integers is given.A triplet (X, Y, Z), such that 0 ≤ X < Y < Z < N, is called a dou

9-2. MaxSliceSumA 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 arr

9-1. MaxProfitAn array A consisting of N integers is given. It contains daily prices of a stock share for a period of N consecutive days. If a single

8-2. EquiLeaderA non-empty array A consisting of N integers is given.The leader of this array is the value that occurs in more than half of the elemen

8-1. DominatorAn 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.F

7-4. StoneWallYou are going to build a stone wall. The wall should be straight and N meters long, and its thickness should be constant; however, it sh

7-3. NestingA string S consisting of N characters is called properly nested if:S is empty;S has the form "(U)" where U is a properly nested string;S h

7-2. FishYou are given two non-empty arrays A and B consisting of N integers. Arrays A and B represent N voracious fish in a river, ordered downstream

7-1. BracketsA string S consisting of N characters is considered to be properly nested if any of the following conditions is true:S is empty;S has the

6-4.NumberOfDiscIntersectionsWe draw N discs on a plane. The discs are numbered from 0 to N − 1. An array A of N non-negative integers, specifying the
6-3. Triangle An array A consisting of N integers is given. A triplet (P, Q, R) is triangular if 0 ≤ P A[R], A[Q] + A[R] > A[P], A[R] + A[P] > A[Q]. For example, consider array A such that: A[0] =...

6-2. MaxProductOfThreeA non-empty array A consisting of N integers is given. The product of triplet (P, Q, R) equates to AP AQ AR (0 ≤ P < Q <

Codility_Distinct6-1. DistinctWrite a functionclass Solution { public int solution(int\[] A); }that, given an array A consisting of N integers, return

5-4. MinAvgTwoSliceA 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

5-3. GenomicRangeQueryFor example, consider string S = CAGCCTA and arrays P, Q such that:The answers to these M = 3 queries are as follows:The part of