Given 2 arrays of ints, A and B, display true if they have the same first element or they have the same last element. Both arrays will be length 1 or more.
Test Case |
Input A | Input B | Program Output |
---|---|---|---|
1 | {1,3,6} | {3,6} | true |
2 | {6,3,6,3,2} | {6,3,5} | true |
3 | {1,3,2} | {3,1} | false |
Solutions: | python | raptor |
Given an array of ints length 3, display the sum of all the elements.
Test Case |
Input |
Program Output |
---|---|---|
1 | {1,2,1} | 4 |
2 | {5,8,9} | 22 |
3 | {1,2,3} | 6 |
Solutions: | python | raptor |
Given an array of ints length 3, "rotate left" the elements, so {1, 2, 3} becomes {2, 3, 1}. Return the changed array.
Test Case |
Input |
Program Output |
---|---|---|
1 | {1, 2, 3} | {2, 3, 1} |
2 | {5, 11, 9} | {11, 9, 5} |
3 | {7, 0, 0} | {0, 0, 7} |
Solutions: | python | raptor |