Write a program for given m*n matrix find its anti diagonal matrix
Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.
input:
python learning
expected output: 16-25-20-8-15-14 12-5-1-18-14-9-14-7
your output: 16-25-20-8-15-14- 12-5-1-18-14-9-14-7
there is is extra " - " after 14 please rectify it !!!
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
input:
4
0 5
1 0
2 10
3 6
4
0 -5
1 0
2 -10
3 -6
expected output:
your output:
(nothing)
please rectify this issue!!
Ordered Matrix:
Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.
input:
3 3
1 20 3
30 10 2
5 11 15
output:
[[1, 2, 3], [5, 10, 11], [15, 20, 30]]expected output:
1 2 3
5 10 11
15 20 30 input:
2 5
-50 20 3 25 -20
88 17 38 72 -10
expected output:
-50 -20 -10 3 17
20 25 38 72 88 please rectify it:
Rotate Matrix Rings
Given a matrix of order M*N and a value K, write a program to rotate each ring of th
The next M lines will contain N space-separated integers.
The next line will contain an integer, denoting K.
Output..The output should be M*N matrix by rotating the matrix by K elements.
Explanation...If the given K is 3. Rotate each ring of the matrix by 3 elements.
In the above matrix, the elements (1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5) is a ring, similarly, the elements (6, 7, 11, 10) will make a ring.
Therefore, by rotating each ring in clockwise direction by 3 elements will give (13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14) and (10, 6, 7, 11). So the output should be
13 9 5 1
14 7 11 2
15 6 10 3
16 12 8 4
Sample Input 1
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
3
Sample Output 1
13 9 5 1
14 7 11 2
15 6 10 3
16 12 8 4
Sample Input 2
3 4
1 2 3 4
10 11 12 5
9 8 7 6
2
Sample Output 2
9 10 1 2
8 11 12 3
7 6 5 4sir give full answer to all test cases will be passed original output
Given a list of integers, write a program to identify the contiguous sub-list that has the largest sum and print the sum. Any non-empty slice of the list with step size 1 can be considered as a contiguous sub-list.Input
The input will contain space-separated integers, denoting the elements of the list.Output
The output should be an integer.
how to write the program for polynomials
how to write the matrix rotation program
how to find out the antidiagonal matrix
given string in camel case and convert the camel case to snake case