My solutions for the codility tests
- 1. Binary Gap [100%]
Find longest sequence of zeros in binary representation of an integer.
-
1. OddOccurrencesInArray [100%]
Find value that occurs in odd number of elements. -
2. CyclicRotation [100%]
Rotate an array to the right by a given number of steps.
-
1. FrogJmp [100%]
Count minimal number of jumps from position X to Y. -
2. PermMissingElem [100%]
Find the missing element in a given permutation. -
3. TapeEquilibrium [83%]
Minimize the value |(A[0] + ... + A[P-1]) - (A[P] + ... + A[N-1])|.
-
1. PermCheck [100%]
Check whether array A is a permutation. -
2. FrogRiverOne [100%]
Find the earliest time when a frog can jump to the other side of a river. -
3. MissingInteger [100%]
Find the smallest positive integer that does not occur in a given sequence. -
4.
RESPECTABLE
MaxCounters
Calculate the values of counters after applying all alternating operations: increase counter by 1; set value of all counters to current maximum.
-
1. CountDiv [100%]
Compute number of integers divisible by k in range [a..b]. -
2. PassingCars
Count the number of passing cars on the road. -
3.
RESPECTABLE
GenomicRangeQuery
Find the minimal nucleotide from a range of sequence DNA. -
4.
RESPECTABLE
MinAvgTwoSlice
Find the minimal average of any slice containing at least two elements.
-
1. Triangle
-
2. Distinct
-
3. MaxProductOfThree
-
4. NumberOfDiscIntersections
-
1. Brackets
-
2. Fish
-
3. StoneWall
-
4. Nesting
-
1. EquiLeader
-
2. Dominator
-
1. MaxDoubleSliceSum
-
2. MaxProfit
-
3. MaxSliceSum
-
1. MinPerimeterRectangle
-
2. CountFactors
-
3. Flags
-
4. Peaks
-
1. CountSemiprimes
-
2. CountNonDivisible
-
1. ChocolatesByNumber
-
2. CommonPrimeDivisors
-
1. FibFrog
-
2. Ladder
-
1. MinMaxDivision
-
2. NailingPlanks
-
1. AbsDistinct
-
2. CountDistinctSlices
-
3. CountTriangles
-
4. MinAbsSumOfTwo
-
1. MaxNonoverlappingSegments
-
2. TieRopes
-
1. NumberSolitaire
-
2. MinAbsSum