I'm working on a tool to generate a timetable for employee up to a month taking into account commercial and labor law constraints. Few challenges and difference from similar problem: The shift concept contains breaks split up to half an hour. There is no concept of full 8 shifts as...

I came across this sequence in a programming contest F(n)= F(n-1)-F(n-2); Given F0 and F1 find nth term (http://codeforces.com/contest/450/problem/B) (the contest is over) Now the solution of this problem is like this The sequence take value f0, f1, f1-f0, -f0, -f1, f0 - f1 then again f0 and the whole...

Suppose we have a pair of input arrays, or a list of (key, value) tuples if you prefer. What's an elegant and performant way to combine values that have indices falling in a certain interval? For example, if the interval (or 'bin') size is 10 then the values of all...

Scenario Let's say you have multiple databases in 3 zones. Zone A, B, and C. Each zone in different geographical location. At the same time, you have an application that will route username and password based on the geographical location of the user. For example, user A will be redirected...

The gotcha with this question is "arbitrary metric". If you don't know what that is, it's just the way to measure distance between points. (In the "real" world, the 1-dimensinal distance is just the absolute magnitude of the difference between the two points). Enough of the pre-lims. I'm trying to...

Suppose G be a planar graph with 16 vertex, that degree of each vertex is 4. When we place this graph on plane as a planar graph, each finite region be a trilateral or foursquare and boundary of infinite region is made up by 4 edges. How many trilateral edge...

a) with sequence X=(x1,x2,...,xn) of positive real numbers, we can find a sub-sequence that elements in this sub-sequence has a maximum product in O(n). b) with an algorithm of order O(n) we can merge m=sqrt(n) sorted sequences that in whole we have n elements. why my professor say these two...

Disclaimer: This is a problem lifted from HackerRank, but their editorial answer wasn't sufficient so I hoped to get better answers. If it's against any policy, please let me know and I'll take this down. Problem: You are given two integers, N and M. Count the number of strings of...

I'm doing an online course and i'm stuck on this question. I know there are similar questions but they don't help me. What is the order of growth of the worst case running time of the following code fragment as a function of N? int sum = 0; for (int...

NOTE: This is for a homework assignment, but the portion I have a question on is ok to ask help for. I have to script out a sequence 11110000111000110010 (i am using python) without using switches or if statements and only a maximum of 5 for and whiles. I already...