## fizzbuzzer

### Looking for good programming challenges?

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

# Archive for January 2017

### Summary ranges challenge

Problem statement Given a sorted integer array without duplicates, return the summary of its ranges for consecutive numbers. For example, given , return . Solution public class SummaryRanges { private static String summary(int[] a) { String ans = “”; int start = a; ans = ans + start; for (int . . . Read more

### Search for a range challenge

Problem statement Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of . If the target is not found in the array, return . For example, given and target value 8, return . . . . Read more

### Minimum window substring challenge

Given a string and a string , find the minimum window in which will contain all the characters in in complexity . Sample Input 0 S = “ADOBECODEBANC” T = “ABC” Sample Output 0 BANC Solution The first step we are going to take is, count the occurrences of each . . . Read more

### Append and delete challenge

Problem statement You have a string, , of lowercase English alphabetic letters. You can perform two types of operations on : Append a lowercase English alphabetic letter to the end of the string. Delete the last character in the string. Performing this operation on an empty string results in an . . . Read more

### Mini-max sum challenge

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers. Input Format A single line of five space-separated integers. Constraints Each . . . Read more

### Kangaroo challenge

There are two kangaroos on an x-axis ready to jump in the positive direction (i.e, toward positive infinity). The first kangaroo starts at location and moves at a rate of meters per jump. The second kangaroo starts at location and moves at a rate of meters per jump. Given the . . . Read more

### The Knuth shuffle

The Knuth shuffle algorithm is an algorithm for randomly shuffling the elements of an array arr of size given a function that generates a uniformly distributed random number in time. The algorithm produces an unbiased permutation. That is, every permutation is equally likely. for i in range(n-1,0,-1): j = integer . . . Read more