Risolto


Leader
An element of a list is called a "leader" if every element to its right (and not just the one immediately to its right) is stric...

8 mesi fa

Risolto


Recursive triangle area
Given triangle 1 with sides of length a, b, and c. Triangle 2 is constructed within triangle 1 by bisecting each side. Triangl...

8 mesi fa

Risolto


Sort by absolute value
Given a list of numbers, arrange them in ascending order based on their absolute values. For example, for the list [-30, -5, 1...

8 mesi fa

Risolto


Perfect shuffle
We call "perfect shuffle" the process of cutting a deck of cards into two equal halves, and then perfectly interleaving them: on...

8 mesi fa

Risolto


Finding the Most Frequent Letter in a Text
You are given a text containing various English letters, digits and punctuation symbols. Your task is to find the most frequentl...

8 mesi fa

Risolto


Calculating the Union Area of Overlapping Rectangles
Calculate the area covered by a union of multiple rectangles. Each rectangle is represented by 4 integers: the first two integer...

8 mesi fa

Risolto


Remove Adjacent Pairs
Given an array of integers where adjacent elements may be identical, your task is to remove these adjacent pairs. If removing on...

8 mesi fa

Risolto


Conditional transpose II
As in problem 60734, you're given two vectors, x and y, which might be row or a column vectors. Your task is to ensure that y ha...

8 mesi fa

Risolto


Conditional transpose
You're given two vectors of the same length, x and y, which might be row or a column vectors. Your task is to ensure that y has ...

8 mesi fa

Risolto


Convert RGB to Grayscale
Convert a 3 element RGB array to its correspoding grayscale pixel (a scalar) *Hint: a formula exists!

8 mesi fa

Risolto


Wheatstone bridge
Determine if a set of resistors maintain Wheatstone bridge equilibrium

8 mesi fa

Risolto


Remove the diagonal of a square matrix
Some Cody problems ask solvers to remove columns (e.g., CP 7), and others ask solvers to remove rows (e.g., CP 44033). Write a...

8 mesi fa

Risolto


Biggest Value in the (Neighbor)Hood
For this challenge you get two inputs: a matrix A and an integer value n. Your function should return a Matrix B of the same siz...

9 mesi fa

Risolto


Final Stone Weight
You are given an array with weights of stones. The objective is to determine the weight of the final stone remaining after all c...

9 mesi fa

Risolto


Determine if a Digit is Isolated
A digit is considered isolated if both its left and right neighbors are different from itself. For example, in the number 776444...

9 mesi fa

Risolto


Missing Number (arithmetic progression)
Given a list of integers forming an arithmetic progression (where the difference between consecutive elements is constant), your...

9 mesi fa

Risolto


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

9 mesi fa

Risolto


Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

9 mesi fa

Risolto


Perimeter of a Koch snowflake
A Koch snowflake is an iteratively generated (fractal) shape built out of successively smaller equilateral triangles by followin...

10 mesi fa

Risolto


Integer Persistence, Product
Let's construct a sequence as follows: is a given natural number, and is the product of the digits of . The persistence of i...

10 mesi fa

Risolto


Given a Polyshape_01 (ps) Return its Perimeter, Area, and Centroid.
Return the perimeter (P) of a polyshape object, which is the sum of the lengths of its boundaries. Return the total area (A) of...

10 mesi fa

Risolto


Battery Charge Indicator
Write a function called battery_charge that visually represents the charge of a battery. The function takes an integer paramete...

10 mesi fa

Risolto


Stern-Brocot Sequence
The Stern-Brocot diatomic sequence is defined as follows: The first elements of the sequence are 0, 1, 1, 2, 1, 3, 2, 3, 1, 4...

10 mesi fa

Risolto


Available ingredients + recipe -> number of cakes
Write a function Egg_Milk_Sugar(L, recipe) to determine the maximum number of cakes that can be prepared given a list of availab...

10 mesi fa

Risolto


Hofstadter Q sequence
The Hofstadter Q sequence is defined as follows: The first elements of the sequence are 1, 1, 2, 3, 3, 4, 5, 5, 6, 6. Write ...

10 mesi fa

Risolto


Reversing Maximal Ascending Subsequences
Create and return a new array that contains the same elements as the input array, but with the elements within each strictly inc...

10 mesi fa

Risolto


Property dispute!
Two neighbors have rectangular plots of land A and B. The surveyors give you the coordinates of each. If they overlap, there is ...

10 mesi fa

Risolto


Sun angle
Determine the angle of the sun above the horizon based on the time of day. Assumptions: the sun rises in the East at 6h00, cor...

11 mesi fa

Risolto


Compress list
Given a non-empty list L of positif integers, compress the list so that only one occurrence is retained if two (or more) equal e...

11 mesi fa

Risolto


Beam me up, Scotty!
It's the mid 22nd century. You, Montgomery Scott, are appointed the chief engineer of the Starship Enterprise. The Starship is...

11 mesi fa

Carica altro