Given a binary string, we can flip all 1s and 0s . Calculate the minimum flips required to make all 1s in left and all 0s in right. There should be at least one 0 and one 1.
Examples:
"1011000" can ...

Berkan Teber

Published on Jan 16th, 2018

Published on Jan 16th, 2018

Consider a coding system for alphabets to integers where ‘a’, ‘b’, ..., ‘z’ are represented as 1, 2, ..., 26. Given a string of digits 1..9 as input, write a function that prints all valid interpre ...

Berkan Teber

Published on Jan 16th, 2018

Published on Jan 16th, 2018

Given an array, find the subarray (containing at least k numbers) which has the largest sum. Return the sum.
Examples:
[-4, -2, 1, -3] and k = 2 should return -1. The subarray is [-2, 1].
[1, 1, 1 ...

Berkan Teber

Published on Jan 16th, 2018

Published on Jan 16th, 2018

An encoded string is given. The pattern in which the strings are encoded is as follows: [substr] means that the substring 'substr' appears count times. The task is to decode the given string.
Exampl ...

Berkan Teber

Published on Jan 16th, 2018

Published on Jan 16th, 2018

Given an array of numbers, the task is to find the maximum value from the string, you can add a ‘+’ or ‘*’ sign between any two numbers. You should also use parantheses.
Examples:
[0, 1, 2, 3, 1] c ...

Berkan Teber

Published on Jan 16th, 2018

Published on Jan 16th, 2018

Consider an undirected tree with N nodes, numbered 1..N. Each node has a label associated with it, which is an integer value. Different nodes can have the same label. You are given a zero indexed arr ...

Berkan Teber

Published on Jan 15th, 2018

Published on Jan 15th, 2018

Given the dimensions of n matrices M1..Mn, what is the minimum number of multiplication in M1 x M2 x ... x Mn.
Example:
Suppose dimensions are given as [10, 30, 5, 60], meaning 3 matrices with dime ...

Berkan Teber

Published on Jan 15th, 2018

Published on Jan 15th, 2018

Given a string you need to print longest possible substring that has exactly k unique characters. If there are more than one substring of longest possible length, return the lexicographically largest ...

Berkan Teber

Published on Jan 15th, 2018

Published on Jan 15th, 2018

There are n pairs and therefore 2n people. Everyone has one unique number ranging in 1..2n. All these 2n persons are arranged in random fashion in an array of size 2n. We are also given who is partne ...

Berkan Teber

Published on Jan 15th, 2018

Published on Jan 15th, 2018

Given an integer array of n integers, find sum of bit differences in all pairs that can be formed from array elements. Bit difference of a pair (x, y) is count of different bits at same positions in ...

Berkan Teber

Published on Jan 15th, 2018

Published on Jan 15th, 2018

Codela is run by you!

Help your fellow members learn faster and raise the quality of challenges by contributing.