Krzysztof Stępniak
17 followers
17 followers
Posts
Post has attachment
Codility solutions - lesson2, exercise: MissingInteger
Content of Codility exercise: Write a function: class Solution { public int solution(int[] A); } that, given a non-empty zero-indexed array A of N integers, returns the minimal positive integer that does not occur in A. For example, given:   A[0] = 1   A[1]...
Post has attachment
Codility solutions - lesson2, exercise: FrogRiverOne
Find the earliest time when a frog can jump to the other side of a river. Content: A small frog wants to get to the other side of a river. The frog is currently located at position 0, and wants to get to position X. Leaves fall from a tree onto the surface ...
Post has attachment
Codility solutions - lesson2, exercise: PermCheck
Check whether array A is a permutation. Content of Codility exercise: A non-empty zero-indexed 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, array A such that:   ...
Post has attachment
Codility solutions - lesson1, exercise: TapeEquilibrium
Content of Codility exercise: A non-empty zero-indexed array A consisting of N integers is given. Array A represents numbers on a tape. Any integer P, such that 0 < P < N, splits this tape into two non-empty parts: A[0], A[1], ..., A[P − 1] and A[P], A[P + ...
Post has attachment
Codility solutions - lesson1, exercise: PermMissingElem
Content of Codility excercise: A zero-indexed array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)], which means that exactly one element is missing. Your goal is to find that missing element. Write a fun...