Flipping
Write code that can reverse the vector without using any sort of loop.
Example
Given the input vector
A = [ 1 2 3 4 5...
5ヶ月 前
解決済み
Triangle sequence
A sequence of triangles is constructed in the following way:
1) the first triangle is Pythagoras' 3-4-5 triangle
2) the second...
5ヶ月 前
解決済み
Flip the bit
Given an input character string (e.g. '1001'), return a character string with the bits flipped ('0110').
5ヶ月 前
解決済み
Flipping a Matrix
Flipping matrix up and down.
If a central row is exists, leave it, and flip remaining rows.
Example
Mat = magic(3)
...
5ヶ月 前
解決済み
swap sign sum & multiply castles
It is an easy problem, if you know the answer.
Given a square matrix of NxN ordinary numbers.
Initially place N identical indi...
5ヶ月 前
解決済み
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10