Risolto


Sum of 2 numbers in array
Given an array and a target sum, return true if any 2 numbers in the array sum up to the given target sum. Both numbers cannot h...

quasi 4 anni fa

Risolto


Draw 'S'
draw S using nxn matrix, where n is odd and greater than 4 S = [1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 ...

quasi 4 anni fa

Risolto


Define an arithmetic sequence
Given three numbers n, a, and d, define an arithmetic sequence of n terms with a being the initial term of the sequence and d be...

quasi 4 anni fa

Risolto


Return longest string in 1-D array of strings
Find the longest string in an array of strings. Return an empty string if the initial array is empty. If there are multiple stri...

quasi 4 anni fa

Risolto


Higher! Lower! Correct!

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


Undocumented MATLAB tricks No. 1 - Save a function-returned struct
Often we face the case when we want to save a function-returned struct to a mat file with each of its field as individual variab...

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


Count of Unique Elements of a Vector
Count the number of times each unique element appears in a vector. Example: Input x = [2 9 1 2 4 9 2] Output y = [1 1; 2 3; 4...

quasi 4 anni fa

Risolto


Find two numbers that add up to the target value
Given a vector A and target n, return the indices of two numbers that add up to n. If there are multiple solutions, return the f...

quasi 4 anni fa

Risolto


Mix it up!
Given an input string S, return a new string B, that is created by taking one character from the front and then the end iterativ...

quasi 4 anni fa

Risolto


Sort vector by number of prime factors of each element
Sort a given array based on how many prime factors each term has. Sort from least to greatest and output original values. Ex: ...

quasi 4 anni fa

Risolto


String Manipulator
Write a script that takes a string as an input and returns a cell array containing – I. the count of vowels. II. Find the ind...

quasi 4 anni fa

Risolto


Weird Diagonal Matrix!!
**If you have loved the problem, please like it below(Request)** Given an integer n, create a matrix whose diagonal elements wi...

quasi 4 anni fa

Risolto


Create a v-notch vector without "sort" function
Given a vector vec, create a v-shaped vector as shown below: vec = [ 10 2 3 89 5 7 90 0 12] Output vector = [90 89 12 10 7 5 3 ...

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


Given an input string, generate a variable name out of it
Given an input string, generate a variable name out of it in easy to read format by a programmer. If the input string contains ...

quasi 4 anni fa

Risolto


Draw a triangle of ones
For any given n, return a matrix that includes a triangle of ones of height n: Example n = 3 output = [0,0,1,0,0 ...

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


string comparision
compare two strings if both are same return 1 else return 0

quasi 4 anni fa

Risolto


Draw a X
Given an input , create a square matrix of zeros with an X of ones. Ex. n = 3 drawX(3) [ 1 0 1 0 1 0 1 0 1 ] ...

quasi 4 anni fa

Risolto


Draw a x-by-x matrix British flag (Euro 2020)
Draw a x-by-x matrix 'British flag' using '0' and '1'.(x is odd and bigger than 4) x = 5 answer = [0 0 1 0 0 ...

quasi 4 anni fa

Risolto


Draw a x-by-x matrix 'Denmark flag'(Euro(2020)
Draw a x-by-x matrix 'Denmark flag' using '4' and '1'.(x is odd and bigger than 4) Number 4: Caption S.Kjær and number 1: K.S...

quasi 4 anni fa

Risolto


Draw a Diamond shape in ones Matrix with '0' s
Input will be odd numbers.The task is to make a Diamond shape in a ones matrix with '0's where the matrix will be a square matri...

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


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

quasi 4 anni fa

Risolto


Bubble sort
Write your own bubble sort function ( <https://en.wikipedia.org/wiki/Bubble_sort>) to sort all elements in x in ascending order....

quasi 4 anni fa

Risolto


Determine whether the given number is palindrome or not.
A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the s...

quasi 4 anni fa

Risolto


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people is gi...

quasi 4 anni fa

Risolto


Altitude of locations on the earth
Find the altitude of a location on the earth, given latitude and longitude coordinates, above mean sea level. Input__________...

quasi 4 anni fa

Carica altro