My Codility Solutions in JS
Practing JavaScript
Lesson 1: Iterations
BinaryGap: Find the size of the longest sequence of zeros in the binary representation of an integer.
Lesson 2: Arrays
CyclicRotation: Rotate array A K times.
OddOccurrencesInArray: Element with odd number of occurrances in an array.
Lesson 3: Time Complexity
FrogJmp: Minimal number of jumps to target
PermMissingElem: Find the missing element in a incomplete sequence.
TapeEquilibrium: Absolute difference between the sum of the first part and the sum of the second part of a sequence.
Lesson 4: Counting Elements
FrogRiverOne: Find the earliest time the frog can cross the river.
MaxCounters: Maximizes n counters.
MissingInteger: Missing positive integer.
PermCheck: Checks if an array has exactly the numbers of a permutation.
Lesson 5: Prefix Sums
CountDiv: Compute number of integers divisible by k in range [a..b].
MinAvgTwoSlice: Find the minimal average of any slice containing at least two elements.
Lesson 6: Sorting
NumberOfDiscIntersections: Compute the number of intersections in a sequence of discs.
Lesson 7: Stacks and Queues
Brackets: Checks if a string is properly nested.
Lesson 9: Maximum slice problem
MaxDoubleSliceSum Find the maximal sum of any double slice.
Lesson 10: Prime and composite numbers
Flags Find the maximum number of flags that can be set on mountain peaks.
Development Workflow
$ yarn test folder/app # TDD with Unit Tests for the folder/app
$ yarn test:coverage # TDD Unit Test coverage
$ yarn start folder/app # Runs the program folder/app