Resuelto


Birthday cake
It's Cody's 5th birthday, and you've been tasked with putting the candles on the cake. Your goal is to maximize the distance bet...

6 días hace

Resuelto


First use of arrayfun() and anonymous function @(x)
Create an anonymous function using @(x) for a parabola equation for the given coefficients stored in s with s(1)x2 + s(2)x + s(...

6 días hace

Resuelto


[Mảng 1 Chiều Cơ Bản]. Bài 5. In phần tử
Cho mảng số nguyên A[] gồm N phần tử, nhiệm vụ của bạn là in ra các phần tử là số chẵn ở chỉ số chẵn, nếu mảng không tồn tại phầ...

8 días hace

Resuelto


[Master Regular Expression] String To Integer
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. The algorithm for myAtoi(string s)...

8 días hace

Resuelto


[Master Regular Expression] Unique Email Addresses
Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email ma...

8 días hace

Resuelto


[Master Regular Expression] Reformat Phone Number
You are given a phone number as a string number. number consists of digits, spaces ' ', and/or dashes '-'. You would like to re...

8 días hace

Resuelto


[Master Regular Expression] Goat Latin
You are given a string sentence that consist of words separated by spaces. Each word consists of lowercase and uppercase letters...

8 días hace

Resuelto


[Master Regular Expression] Keyboard Row
Given an array of strings words, return the words that can be typed using letters of the alphabet on only one row of American ke...

8 días hace

Resuelto


Chào các bạn.
Cho 3 số. Tính tổng của chúng

13 días hace

Resuelto


Jump Game
Bạn được cho một mảng số nguyên nums. Ban đầu bạn được đặt ở vị trí chỉ mục đầu tiên của mảng, và mỗi phần tử trong mảng biểu th...

19 días hace

Resuelto


Leo Bậc Thang
Bạn đang leo cầu thang. Cần n bước để lên đến đỉnh. Mỗi lần bạn có thể leo 1 hoặc 2 bước. Hỏi có bao nhiêu cách khác nhau để le...

19 días hace

Resuelto


Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You m...

alrededor de 1 mes hace

Resuelto


Pascal's pyramid
In Pascal's triangle each number is the sum of the two nearest numbers in the line above: 1 1 1 ...

alrededor de 1 mes hace

Resuelto


Generate this matrix
Generate the following matrix. n = 2; out = [-4 -3 -2 -1 0 -3 -2 -1 0 1 -...

alrededor de 1 mes hace

Resuelto


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

alrededor de 1 mes hace

Resuelto


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

alrededor de 1 mes hace

Resuelto


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

alrededor de 1 mes hace

Resuelto


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

alrededor de 1 mes hace

Resuelto


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

alrededor de 1 mes hace

Resuelto


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. For...

alrededor de 1 mes hace

Resuelto


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

alrededor de 1 mes hace

Resuelto


Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

alrededor de 1 mes hace

Resuelto


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE ...

alrededor de 1 mes hace

Resuelto


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The values of B are in the same order a...

alrededor de 1 mes hace

Resuelto


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

alrededor de 1 mes hace

Resuelto


Getting the indices from a matrix
Inspired by Problem 645. Getting the indices from a matrix. Given a matrix A (or a vector), return the indices (always in row...

alrededor de 1 mes hace

Resuelto


Construct an index vector from two input vectors in vectorized fashion
Create an index vector defined by two input vectors, one defining the beginnings of one or more index ranges, and the other defi...

alrededor de 1 mes hace

Resuelto


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

alrededor de 1 mes hace

Resuelto


How to reverse spdiags?
The spdiags function extracts all nonzero diagonals from the m-by-n matrix A. So if A=[1 2 3;4 5 6;7 8 9], spdiags(A)=[7 4...

alrededor de 1 mes hace

Resuelto


Back to Basics - New Data Type in R2016b - convert a char to a string
Convert an char array into a string.

alrededor de 2 meses hace

Cargar más