Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. // you can use includes, for example:
  2. // #include <algorithm>
  3.  
  4. // you can write to stdout for debugging purposes, e.g.
  5. // cout << "this is a debug message" << endl;
  6. #include <vector>
  7. int solution(vector<int> &A) {
  8.     // write your code in C++14 (g++ 6.2.0)
  9.    
  10.     int temp=0, size=0, Size=0, i=0, j=0;
  11.     Size = A.size();
  12.     vector<int> a(Size);
  13.     vector<int>::iterator iter;
  14.    
  15.    
  16.     // cout << "temp: ";
  17.     for(i=0; i<Size; i++){
  18.         temp = A[i];
  19.         size = a.size();
  20.         cout << "temp1: " << temp << " size: " << size << endl;
  21.         for(j=0; j<size; j++){
  22.             if(a[j] != temp){
  23.                 cout << "j = " << j << endl;
  24.                 a[j] = temp;
  25.                 cout << "a.at(" << j << "): " << a.at(j) << endl;
  26.             }
  27.         }        
  28.     }
  29.    
  30.     return a.size();
  31.    
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement