Solved


Percentage profit:3
x% product is sold at r1% profit. However, our target overall profit is rt%. What is the required percentage profit to meet the ...

21 days ago

Solved


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

21 days ago

Solved


Leading-zero padding
Write a function that will add leading-zero padding to all numbers in the supplied vector, as necessary, based on the maximum nu...

21 days ago

Solved


Generalized Fibonacci
The Fibonacci sequence is defined as: Fib(1) = 0 Fib(2) = 1 Fib(N) = Fib(N-1) + Fib(N-2) The Fibonacci sequence can be gener...

21 days ago

Solved


Iterative sum of digits of 2^n number
Given n, calculate the number 2^n (where n>=0) and iterate until the sum of the digits is a single-digit number. Example: Inp...

21 days ago

Solved


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Input...

21 days ago

Solved


Compute Fibonacci Number
Compute the n-th Fibonacci Number f(0) = 0, f(1) = 1, f(2) = 1, f(3) = 2, ... f(42) = 267914296

21 days ago

Solved


GJam 2013 Veterans: Ocean View (Small)
This Challenge is derived from <http://code.google.com/codejam/contest/2334486/dashboard#s=p2 GJam 2013 Veterans Ocean View>. Th...

21 days ago

Solved


Remove Missing Values from a Table or an Array
Remove missing entries from an array or table. If A is a vector, then remove any entry that contains missing data. If A is a mat...

21 days ago

Solved


Modulo with 5

21 days ago

Solved


Logic 7

21 days ago

Solved


IQpuzzler Preparation #2: Detect isolated zeros in a 2D matrix
Return true if any isolated single zeros are present in the input M-by-N matrix (zeros with all adjacent elements being non-zero...

21 days ago

Solved


Sample from random roulette
Given a list of values and their probabilities sample 10,000 values. Example: x = [1 2 3 4 5]; prob = [0.2 0.1 0.4 0.1 0.2] ...

21 days ago

Solved


A kind of decryption
Please convert the vector to letters by referring to the examples below. (eg.1) input vec=[34 1 59] >>> output s='A Z' (eg...

21 days ago

Solved


Find the remainder with the factorial of PRIMES?
* Take a number greater than or equal to 2 and take its primes. e.g. 6 and its primes are 2 3 5 * calculate the factorial of i...

21 days ago

Solved


Decrypt the cypher using XOR encryption (for beginners)
Inspired by Project Euler n°59 Each character on a computer is assigned a unique code and the preferred standard is ASCII (...

21 days ago

Solved


Beauty of Parentheses
Given a string consisting of closed parentheses, form a string array in the following way so that the orders of these parenthese...

21 days ago

Solved


Use a timetable to analyze a train timetable (Part 2)
Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. Yo...

21 days ago

Solved


Use a timetable to analyze a train timetable (Part 4)
You are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily tri...

21 days ago

Solved


Use a timetable to analyze a train timetable (Part 3)
Oh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston ...

21 days ago

Solved


Use a timetable to analyze a train timetable (Part 5)
You are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each d...

21 days ago

Solved


Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

22 days ago

Solved


Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

22 days ago

Solved


Greed is good - Simple partition P[n].
Find a simple partition P[n]. E.g. P[10] = 4 + 3 + 2 + 1. There are many solutions, compute just one set. Don't repeat numbers...

22 days ago

Solved


Kaprekar Steps
6174 is the Kaprekar constant. All natural numbers less than 10,000 (except some with same digits) can be reduced to 6174 in the...

22 days ago

Solved


Permutation
How many different words can be formed using all the letters(together) from a given input word? Input is a string.

22 days ago

Solved


Avengers Assemble!
Given matrix with so many zeroes, trim those zeroes and output a matrix joining all nnz elements Example: input = [0 0 0 0 0; 0...

22 days ago

Solved


Chromatic Tuner
Given a frequency, return the number of cents difference between the given frequency and its nearest semitone (in 12-tone equal ...

22 days ago

Solved


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some strin...

22 days ago

Solved


Determine the winner of a goofy golf tournament
My brother and father were playing golf one day, and they caught up to a group that was part of a tournament. The group members ...

22 days ago

Load more