Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- // РАЗМЕСТИТЕ ВАШ КОД ЗДЕСЬ
- void TestCountArrayRotations(std::vector<int> arr, int expectedRotations) {
- std::cout << "Array: ";
- for (auto i: arr) {
- std::cout << i << " ";
- }
- std::cout << " | ";
- int rotations = CountArrayRotations(arr);
- if (rotations == expectedRotations) {
- cout << "Passed" << endl;
- } else {
- cout << "Failed (" << expectedRotations << " != " << rotations << ")" << endl;
- }
- }
- int main() {
- TestCountArrayRotations({1, 1, 8, 0}, 1);
- TestCountArrayRotations({1, 2, 3, 4}, 3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment