Given a 2D matrix print it in spiral form. That is start from the top left corner and traverse clockwise.
Example
When the above code is implemented it outputs 3, 5, 4, 1, 2, 13, 18, 7, 1, 6, 5, 4, 10, 9, 8, 2
What will the above function output when the following Matrix is inputted.
Given a 2D square Array,write a method that finds the product of all elements in column . Also write a method that returns the sum of all elements in row .
In the matrix below, let be the sum of all column products and let be the sum of all row sums. What are the last three digits of ?
1 2 3 4 5 6 7 8 9 10 |
|
Given an array and a number , write a function that determines if there exists a contiguous sub-array whose sum is .
Which of the below arrays contains a sub-array whose sum is ?
A. {61, 6, 39, 29, 30, 72, 98, 36, 42, 66, 24, 58, 13, 16, 73}
B. {87, 78, 4, 10, 48, 43, 33, 70, 21, 18, 75, 66, 39, 80, 87}
C. {82, 72, 39, 67, 65, 93, 28, 2, 89, 39, 68, 29, 61, 14, 98}
D. {45, 5, 14, 75, 100, 37, 98, 64, 90, 52, 66, 30, 18, 89, 19}