解決済み


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...

15日 前

解決済み


Maximizing Stock Profit
As a stock exchange broker focusing on a single transaction, your goal is to maximize profit by buying a stock at a low price an...

15日 前

解決済み


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

15日 前

解決済み


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

15日 前

解決済み


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...

15日 前

解決済み


Limiting Element Occurrences
You are given a list 'v' of numbers. This list may contain repeated numbers. Your objective is to create a new list that maintai...

15日 前

解決済み


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...

15日 前

解決済み


Counting the occurrences of a digit in a book
The printer has printed a book with 'p' pages. How many times did they use the character 'd'? In other words, how many times doe...

15日 前

解決済み


Absolute Sorting
Given an array with various numbers, your have to sort it by absolute value in ascending order. For example, for the array [-2...

15日 前

解決済み


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...

15日 前

解決済み


Pronounce digits
Given a number num, select the first d decimal places and pronounce the digits (in English). The function returns the pronunciat...

15日 前

解決済み


Spreadsheet Column Number
Spreadsheet uses an alphabetic naming system for columns, starting with 'A', 'B', 'C', etc. The column names continue like 'AB',...

15日 前

解決済み


Pivot index
Let L be a vector of numbers. We are searching for the index n of the pivot element defined as follows: the dot product of the e...

15日 前

解決済み


Interval Compression
Given a set of integers, the task is to create a list of closed intervals where each interval includes its endpoints. For exampl...

15日 前

解決済み


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...

15日 前

解決済み


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...

15日 前

解決済み


Family Savings Analysis
Given the bank accounts of individuals defined by a list of tuples containing the last name, first name, and savings: accounts ...

15日 前

解決済み


Find the triplet
Given an array x of size n > 3 and an integer N, return the indices of three elements in the array that sum up to the given inte...

15日 前

解決済み


Largest Rectangle Area in a Histogram
Given a histogram represented by an array of integers, e.g., [2, 1, 4, 5, 1, 3, 3] : find the maximum area of a rectangle tha...

15日 前

解決済み


Extract Increasing Integers from Digit String
Given a string containing only digits, the function get_integers should return the list of increasing integers obtained by readi...

15日 前

解決済み


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...

15日 前

解決済み


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

15日 前

解決済み


Merge two integers
We want to merge the digits of two integers having the same number of digits to obtain a new integer whose digits are obtained b...

15日 前

解決済み


snake_case to CamelCase convention
The snake_case naming convention writes words in lowercase and separates them with underscores. In CamelCase convention, the fir...

15日 前

解決済み


Sum all elements of a vector or matrix without using some built in functions
Write a function that computes the sum of all elements of the input array v without using the following built-in function: sum,...

15日 前

解決済み


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...

15日 前

解決済み


Linearly Spaced Array
Create a linearly spaced array from 0 to x consisting of y elements.

15日 前

解決済み


Double the 2x2 Matrix
In this challenge, you are given a predefined 2x2 matrix called x. Your task is to multiply every element in this matrix by 2 an...

15日 前

解決済み


Sum of even numbers in a vector
Write a function that takes a vector of numbers and returns the sum of all the even numbers in the vector.

15日 前

解決済み


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...

15日 前

さらに読み込む