# # codility

## Lesson 6 - NumberOfDiscIntersections

We 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 radiuses of the discs, is gi

## Lesson 6 - Triplet

An array A consisting of N integers is given. A triplet (P, Q, R) is triangular if 0 ≤ P < Q < R < N and:AP + AQ > AR,AQ + AR > AP,AR + AP >

## [Codility]Lesson8/Leader/EquiLeader

A 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 elements of A.An equi

## [Codility]Lesson5/PrefixSums/GenomicRangeQuery

https://app.codility.com/demo/results/trainingRNBDPW-72S/A DNA sequence can be represented as a string consisting of the letters A, C, G and T, w

## [Codility]Lesson1/Iterations/BinaryGap

https://app.codility.com/demo/results/trainingV47U7M-RBU/A binary gap within a positive integer N is any maximal sequence of consecutive zeros th

## [Codility]Lesson16/Greedy/MaxNonoverlappingSegments

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 seg

## [Codility]Lesson15/CaterpillorMethod/AbsDistinct

A non-empty array A consisting of N numbers is given. The array is sorted in non-decreasing order. The absolute distinct count of this array is the nu

## [Codility]Lesson12/Euclidean algorithm/ChocolatesByNumbers

Two positive integers N and M are given. Integer N represents the number of chocolates arranged in a circle, numbered from 0 to N − 1.You start to eat

## [Codility]Lesson11/SieveOfEratosthenes/CountNonDivisible

https://app.codility.com/demo/results/training9GEGBK-XZE/// you can also use imports, for example:// import java.util.\*;// you can write to stdo

## [Codility]Lesson10/Prime and Composite Numbers/CountFactors

A 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 factor of 24, because M

## Lesson 6 - MaxProductOfThree

A 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 < R < N).For example

## [Codility]Lesson9/MaximumSliceProblem

An 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 share was boug

## Lesson 6 - distinct

Write a functionclass Solution { public int solution(int\[] A); }that, given an array A consisting of N integers, returns the number of distinct value

## Lesson 5 - MinAvgTwoSlice

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 (notice

## Lesson 5 - GenomicRangeQuery

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

## Lesson 5 - CountDiv

Write a function:class Solution { public int solution(int A, int B, int K); }that, given three integers A, B and K, returns the number of integers wit

## Lesson 5 - Prefix Sum

A non-empty array A consisting of N integers is given. The consecutive elements of array A represent consecutive cars on a road.Array A contains only

## Lesson 4 - MissingInteger

This is a demo task.Write a function:class Solution { public int solution(int\[] A); }that, given an array A of N integers, returns the smallest posit

## Lesson 4 - MaxCounters;

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

## Lesson 4 - PermCheck

A non-empty array A consisting of N integers is given.A permutation is a sequence containing each element from 1 to N once, and only once.For example,