Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

Archive for December 2016

Absolute permutation challenge

Problem statement We define to be a permutation of the first natural numbers in the range . Let denote the position of in permutation (please use -based indexing). is considered to be an absolute permutation if holds true for every . Given and , print the lexicographically smallest absolute permutation, . . . Read more

Simple token field for AngularJS

I was searching the net for a very, very simple token field for AngularJS the other day to use on a side project that I was working on. Unfortunately I couldn’t find anything that suits my requirements. So I implemented my own. Here is how to use it. (Optional) Install . . . Read more

Short palindrome challenge

Problem statement Consider a string, , of lowercase English letters where each character, , denotes the letter at index in . We define an palindromic tuple of to be a sequence of indices in satisfying the following criteria: , meaning the characters located at indices and are the same. , . . . Read more

Angry children 2 challenge

Problem statement Bill Gates is on one of his philanthropic journeys to a village in Utopia. He has packets of candies and would like to distribute one packet to each of the children in the village (each packet may contain different number of candies). To avoid a fight between the . . . Read more

Lily’s homework challenge

Problem statement Whenever George asks Lily to hang out, she’s busy doing homework. George wants to help her finish it faster, but he’s in over his head! Can you help George understand Lily’s homework so she can hang out with him? Consider an array of distinct integers, . George can . . . Read more

House robber 2 challenge

Problem statement After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arranged in a circle. That means the first house is the neighbor of . . . Read more

House robber challenge

Problem statement You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two . . . Read more

Fraudulent activity notifications challenge

Problem statement The National Bank has a simple policy for warning clients about possible fraudulent account activity. If the amount spent by a client on a particular day is greater than or equal to the client’s median spending for the last days, they send the client a notification about potential . . . Read more

Counting sort

Problem statement In this challenge you need to print the data that accompanies each integer in a list. In addition, if two strings have the same integers, you need to print the strings in their original order. Hence, your sorting algorithm should be stable, i.e. the original order should be . . . Read more