Тёмный

Matrix - Right Shift | Skillrack Daily Test Today's Solution | Skillrack 

Trending Videos Tech
Подписаться 814
Просмотров 575
50% 1

Matrix - Right Shift
Skillrack Daily Test Today's Solution
Skillrack Daily Test
Matrix - Right Shift
The program must accept an integer matrix of size RxC and an integer N as the input. The program must form a list of integers by traversing the matrix spirally in clockwise direction. Then the program must shift the integers to the right by N positions. Finally, the program must print the modified list of integers in the form of RxC matrix as the output.
Boundary Condition(s):
2 = R, C = 100
1 = N = 1000
Input Format:
The first line contains R and C separated by a space.
The next R lines, each contains C integers separated by a space.
The (R+2)nd line contains N.
Output Format:
The first R lines, each contains C integers separated by a space.
Example Input/Output 1:
Input:
4 4
10 20 30 40
50 60 70 80
90 91 92 93
94 95 96 97
5
Output:
50 60 70 92
91 10 20 30
40 80 93 97
96 95 94 90
Explanation:
The list of integers formed by traversing the 4x4 matrix spirally in clockwise direction is given below.
10 20 30 40 80 93 97 96 95 94 90 50 60 70 92 91
Here N = 5.
After shifting the integers to the right by 5 positions, the list becomes 50 60 70 92 91 10 20 30 40 80 93 97 96 95 94 90.
So they are printed in the form of 4x4 matrix.
50 60 70 92
91 10 20 30
40 80 93 97
96 95 94 90
Example Input/Output 2:
Input:
5 3
1 2 3
4 5 6
7 8 9
2 3 4
8 9 1
18
Output:
5 8 3
1 2 3
6 9 4
1 9 8
2 7 4
Matrix - Right Shift
Skillrack Daily Test
Today's Solution
ProgramID- 7767
#skillrack #skillrackdailytest #coding #programming #code #education #educational
Please follow all of these
• Twitter - / trendtechpost
• Threads - www.threads.net/@trendingvide...

Опубликовано:

 

16 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@TrendingVideosTech
@TrendingVideosTech 28 дней назад
Skillrack Daily Test Matrix - Right Shift The program must accept an integer matrix of size RxC and an integer N as the input. The program must form a list of integers by traversing the matrix spirally in clockwise direction. Then the program must shift the integers to the right by N positions. Finally, the program must print the modified list of integers in the form of RxC matrix as the output. Boundary Condition(s): 2
@user-kx1yi1fn6r
@user-kx1yi1fn6r 28 дней назад
🤓👍
Далее
Smart Sigma Kid #funny #sigma #comedy
00:19
Просмотров 3,9 млн
A riccati differential equation
8:48
Просмотров 608
3 Tips I’ve learned after 2000 hours of Leetcode
0:44
c# to solidity conversion of core models
1:10:01
Просмотров 1 тыс.
NEET 2024 dress code in Tamil
13:33
Просмотров 120 тыс.
How To Play Minecraft On Meta Quest 3! (2024)
15:33
Просмотров 3,9 тыс.
Stow is the best way to manage your dot files
14:33
Просмотров 7 тыс.
Smart Sigma Kid #funny #sigma #comedy
00:19
Просмотров 3,9 млн