문제를 풀었습니다


Element-wise vector product (★)
Given two vectors x and y, compute their element-wise product z. Thus, if x = [1 3 5] and y = [0.5 -1 2], then z = [1*0.5...

대략 4년 전

문제를 풀었습니다


Create a vector of the first n odd numbers (★)
If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

대략 4년 전

문제를 풀었습니다


Median computation (★)
Given a vector of values, compute the median. The median is defined as the middle value in a set of *sorted* data. Thus, if ...

대략 4년 전

문제를 풀었습니다


Create a vector with n repeated values of a number x (★★)
If x=3 and n=7 then the vector y would be y=[3 3 3 3 3 3 3]

대략 4년 전

문제를 풀었습니다


Sum of elements in a vector (★)
(copy of Prob. 3) Find the sum of all the numbers of the input vector x. Input x = [1 2 3 5] Output y is 11 <> ...

대략 4년 전

문제를 풀었습니다


How to locate the position of an element in a vector without using the find function
(copy of prob 105 with test for find function) Write a function posX = *locatePos* (x,y) which returns the location o...

대략 4년 전

문제를 풀었습니다


Let's create histogram data by yourself.
We'd like to create histogram data, which first column shows the data, and second column shows the frequency. input = [1, 2, ...

대략 4년 전

문제를 풀었습니다


Matrix for beginners
Multiply x and y elemwise.

대략 4년 전

문제를 풀었습니다


Times 5
Try out this test problem first. Given the variable x as your input, multiply it by five and put the result in y. Examples...

대략 4년 전

문제를 풀었습니다


Count digits
Count total number of digits from 1 to n. * n=13 * output=17 since from [1-9] total 9 digits.[10-13] total 4*2=8 digits.

4년 초과 전

문제를 풀었습니다


Last non-zero digit
Given a number n, find the last non-zero digit of the factorial of that number. You need to take care of the large values of n....

4년 초과 전

문제를 풀었습니다


Do they touch?
The center and radius of two circles are given. Determine whether they touch.

4년 초과 전

문제를 풀었습니다


Area-06
The length of the side of a square is given. Draw 4 quarter-circles inside the square from 4 corners with a radius equal to t...

4년 초과 전

문제를 풀었습니다


Area-04
The dimension of a rectangle is given. There are two circles of equal size that are inscribed inside it.The circles are tangent ...

4년 초과 전

문제를 풀었습니다


Area-03
There are two circles of equal size are inscribed inside a square. They are tangent to each other. <https://serving.photos.ph...

4년 초과 전

문제를 풀었습니다


Area-02
Given the radius of the circle inscribed in a square, find the area of the square that can be fitted perfectly in the corner. ...

4년 초과 전

문제를 풀었습니다


Area-01
Given the radius of the circle inscribed in a square, find the area that is not bounded by the circle but inside the square. ...

4년 초과 전

문제를 풀었습니다


Take it out
Consider the integer number sequence N (1 to infinity). After each iteration, take out the (k+1)th elements; where k is the n...

4년 초과 전

문제를 풀었습니다


Ugly numbers - 03
For this case, a number is defined ugly if it has prime factors consisting of only elements of x. Find the nth ugly number. ...

4년 초과 전

문제를 풀었습니다


Ugly numbers - 02
Ugly numbers are those whose prime factors are 2, 3 or 5. find the nth ugly number. n.b. unlike the previous problem,trivi...

4년 초과 전

문제를 풀었습니다


Ugly numbers - 01
Ugly numbers are those whose prime factors are 2, 3 or 5. find the nth ugly number.

4년 초과 전

문제를 풀었습니다


How many Christmas presents under the tree?
For many families at Christmas, each family member gives 1 present to every other family member. The main exception is that chil...

4년 초과 전

문제를 풀었습니다


Question 1
Implement a function named q1 with one input argument named n. This function should return the multiplication of all odd numbers...

4년 초과 전

문제를 풀었습니다


Queen's move
given a number of consecutive moves of queen, check for their validity based on their previous position.... but remember if u g...

4년 초과 전

문제를 풀었습니다


generate the matrix
given 3 inputs e.g [2,3,4] -- generate a matrix like below -- [2 2 0 0 0 0 0 0 0; 2 2 0 0 0 0 0 0 0; 0 0 3 3 3 0 0 0 0; 0 0...

4년 초과 전

문제를 풀었습니다


Calculating large fibonacci numbers
The fibonacci sequence starts 1,1,2,3,5,8... Find the the n'th fibonacci number. Then calculate round(log10( . )) of that n't...

4년 초과 전

문제를 풀었습니다


Generate Golomb's sequence
Generate Golomb's sequence up to the given number. If n=4, then seq = [1, 2, 2, 3, 3, 4, 4, 4] If n=6, then s...

4년 초과 전

문제를 풀었습니다


Put m balls into n boxes
Can you find all the cases where, if I put 3 balls into 2 boxes the case is 1 1 1 1 1 2 1...

4년 초과 전

문제를 풀었습니다


Next lexicographic - permutation
Find next lexicographic - permutation (permutations as it would occur in a dictionary order). E.g: nextP('ABCD') = ABDC I...

4년 초과 전

문제를 풀었습니다


N-th permutation.
Let write some permutations of positive integers. 1: 1 2 3 4 5 6 ... 2: 2 1 3 4 ... 3: 1 3 2 4 ... ...

4년 초과 전

더 보기