text: vector<int> solution(vector<int> &A, int K) {
      int n = A.size();
      if (K == 0) {
          return A;
      }
      if (n == 0) {
          return {};
      }
      
      int m = K % n;
      vector<int> result;
  
      for (int i=n-m; i<n; ++i) {
          result.push_back(A[i]);
      }
  
      for (int i=0; i<n-m; ++i) {
          result.push_back(A[i]);
      }
  
      return result;
  }
  