Solved


Draw "T" inside a Zero Matrix
Given a x-by-x matrix filled with zeros (x> 2). Use 1 to draw a letter "T" into it! Like this: x = 5, y = 1 1 1 1 1 0 0 1 0 0...

1 month ago

Solved


Draw "C" in a zero matrix
Given a x-by-x matrix filled with zeros (x> 4). Use 1 to draw a letter C into it! Like this: x = 5, y = 1 1 1 1 1 1 0 0 0 1 ...

1 month ago

Solved


Determine Poker Hand Winner
Determine the poker hand winner from two hands of cards (each hand will contain the same number of cards between five and thirte...

1 month ago

Solved


Area of a regular hexagon
Given the length of a side of a regular hexagon, return its area rounded to two decimal places.

1 month ago

Solved


Merge structs on fields
Merge a bunch of structs into one, containing the field names and corresponding values of all input structs. For duplicate field...

1 month ago

Solved


Curry a function handle
From Wikipedia, Currying: In mathematics and computer science, currying is the technique of converting a function that takes mu...

1 month ago

Solved


Exhaust all possible logical vectors
Input a length argument and list all possible logical vectors of that length. My solution is of size 29. Can you find an even s...

1 month ago

Solved


minimum numbers of 1 to build n
The (Mahler-Popken) complexity of n: minimal number of 1's required to build n using + and *. see A005245. In this problem, yo...

1 month ago

Solved


String Logic 18
Examples: 'DIG' --> 'DG' 'IMPORTANT' --> 'IPRAT' 'DEAL' --> 'DA' 'LIMB' --> 'LM' 'MOSTLY' --> 'MSL'

1 month ago

Solved


String Logic 17
Examples: 'DIG' --> 'GDI' 'IMPORTANT' --> 'TANTIMPOR' 'DEAL' --> 'EALD' 'LIMB' --> 'IMBL' 'MOSTLY' --> 'YMOSTL'

1 month ago

Solved


String Logic 16
Examples: 'DIG' --> 'DIG' 'KIMBALL' --> 'ALLKIMB' 'DEAL' --> 'EALD' 'LIMB' --> 'IMBL' 'MADE' --> 'ADEM'

1 month ago

Solved


String Logic 13
Examples: 'CAT' --> 'TCA' 'DOG' --> 'OGD' 'ROSY' --> 'YSRO' 'MOSTLY' --> 'YTSOML'

1 month ago

Solved


String Logic 4
Example: 'CAT' --> 'IGZ' 'DOG' --> 'JUM' 'MATLAB' --> 'SGZRGH' 'ROSY' --> 'XUYE' 'TRUST' --> 'ZXAYZ' 'MOSTLY' --> 'SUYZ...

1 month ago

Solved


String Logic 3
Example: 'CAT' --> 'RPI' 'DOG' --> 'SDV' 'MATLAB' --> 'BPIAPQ' 'ROSY' --> 'GDHN' 'TRUST' --> 'IGJHI' 'MOSTLY' --> 'BDHI...

1 month ago

Solved


String Logic 1
Examples: 'CAT' --> 'IGZ' 'DOG' --> 'JUM'

1 month ago

Solved


Distance walked 3D
suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...

1 month ago

Solved


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

1 month ago

Solved


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

1 month ago

Solved


Create the Ulam spiral
Have you ever seen this wonderful spiral ? The Ulam Spiral is arranging prime numbers in a clockwise spiral starting in 0. Give...

1 month ago

Solved


Get the n-th rand number with given seed
Given seed s, return the n-th rand number using rand(). Round the answer with 4 digits. n is a postive integer.

1 month ago

Solved


Check if a matrix Diagonal is equal to its secondary diagonal
Your function should return True if the secondary diagonal is equal to diagonal, and False otherwise. Eg: M = [1 2 1 ...

1 month ago

Solved


Ramanujan's Number
About 1729 1729 is the first positive integer which can be expressed as the sum of two positive cubes in two different ways. ...

1 month ago

Solved


Draw the symbol '+'
Draw '+' in an x-by-x matrix (where x is odd and x >3) Example: x = 5 y = [0 0 1 0 0 0 0 1 0 0 1 1 1 1 1 0 ...

1 month ago

Solved


Determining if a Degree Sequence is Potentially a Graph
A degree sequence is a list of numbers representing the degrees of vertices in a graph. While it is difficult to tell if a graph...

1 month ago

Solved


Add the number of horizontal and vertical movements to each matrix element
Given n, create a square matrix and with element (1,1) = 1, add 1 to each element for each horitizonal and vertical movement. E...

1 month ago

Solved


Determine Center of Mass for a Set of Floating Spheres
Each sphere has a position determined by theta (x,y plane angle) and tau (elevation angle) as well as L, the distance of the cen...

1 month ago

Solved


Draw 'Y'
Draw 'Y' in an x-by-x matrix (where x is odd and x >= 3) Examples: x = 3 y = [1 0 1 0 1 0 0 1 0] x = 5 y = [1...

1 month ago

Solved


Matrix Rotation
You are given a 2D matrix of dimension [m,n] and a positive integer r. You have to rotate the matrix r times and print the resul...

1 month ago

Solved


Circle Division
A circle can be divided into 2 sections, by placing 2 points in arbitrary locations along its circumference and drawing a straig...

1 month ago

Solved


Backgammon #4 - Dice Probabilities
Previous problems in this series have looked at how a backgammon board might be represented, and board positions manipulated and...

1 month ago

Load more