This project contains solutions for Codility algorithm problems in Kotlin.
Codility is a platform where programmers can find challenges and solve them to improve/train their coding skills.
Here you can find the questions:
Lesson 1 - Iterations
- BinaryGap: Find longest sequence of zeros in binary representation of an integer.
Lesson 2 - Arrays
- OddOccurrencesInArray: Find value that occurs in odd number of elements.
- CyclicRotation: Rotate an array to the right by a given number of steps.
Lesson 3 - Time Complexity
- FrogJmp: Count minimal number of jumps from position X to Y.
- PermMissingElem: Find the missing element in a given permutation.
- TapeEquilibrium: Minimize the value |(A[0] + ... + A[P-1]) - (A[P] + ... + A[N-1])|.
Lesson 4 - Counting Elements
- PermCheck: Check whether array A is a permutation.
- FrogRiverOne: Find the earliest time when a frog can jump to the other side of a river.
- MaxCounters: Calculate the values of counters after. applying all alternating operations: increase counter by 1; set value of all counters to current maximum.
- MissingInteger: Find the smallest positive integer that does not occur in a given sequence.
Lesson 5 - Prefix Sums
- PassingCars: Count the number of passing cars on the road.
- GenomicRangeQuery: Find the minimal nucleotide from a range of sequence DNA.
- MinAvgTwoSlice: Find the minimal average of any slice containing at least two elements.
- [CountDiv:]
Lesson 6 - Sort
- MaxProductOfThree: Maximize A[P] * A[Q] * A[R] for any triplet (P, Q, R).
- Distinct: Compute number of distinct values in an array.
- Triangle: Determine whether a triangle can be built from a given set of edges.
- [NumberOfDiscIntersections:]
Lesson 7 - Stacks and Queues
- Brackets: Determine whether a given string of parentheses (multiple types) is properly nested.
- Fish: N voracious fish are moving along a river. Calculate how many fish are alive.
- Nesting: Determine whether a given string of parentheses (single type) is properly nested.
Some other questions:
- Battleships in a board
- Elevator problem
- LongestConsecutive
- OCR
- PrepareHamburgers
- Seasons