Rust Taskbook Level 10.8

Задание 1

Write a program that will check whether it is possible to obtain from one string another by rearranging its letters.

Задание 2

Implement the Eratosthenes algorithm to find prime numbers in a given interval.

Задание 3

Given an arbitrary two-dimensional array:

rust[
  [11, 12, 13, 14, 15],
  [21, 22, 23, 24, 25],
  [31, 32, 33, 34, 35],
  [41, 42, 43, 44, 45],
  [51, 52, 53, 54, 55],
}

Swap the two given rows:

rust[
  [51, 52, 53, 54, 55],
  [21, 22, 23, 24, 25],
  [31, 32, 33, 34, 35],
  [41, 42, 43, 44, 45],
  [11, 12, 13, 14, 15],
}
Задание 4

Given an arbitrary two-dimensional array:

rust[
  [1, 2, 3, 4, 5],
  [1, 2, 3, 4, 5],
  [1, 2, 3, 4, 5],
  [1, 2, 3, 4, 5],
  [1, 2, 3, 4, 5],
}

Get the sum of the columns of this array. Present the result as an array of sums:

rust[
  5, 10, 15, 20, 25
}
Задание 5

Given a string containing any number of nested paired parentheses, write code that will check that the parentheses are positioned correctly.

This is correct:

rust"()()"

This is correct:

rust"(())"

This is incorrect, since the number of open brackets does not match the number of closed ones:

rust"())"

This is incorrect, because although the number of open brackets matches the number of closed ones, they are in the wrong order:

rust"))(("