Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // you can use includes, for example:
- // #include <algorithm>
- // you can write to stdout for debugging purposes, e.g.
- // cout << "this is a debug message" << endl;
- #include <vector>
- int solution(vector<int> &A) {
- // write your code in C++14 (g++ 6.2.0)
- int temp=0, size=0, Size=0, i=0, j=0;
- Size = A.size();
- vector<int> a(Size);
- vector<int>::iterator iter;
- // cout << "temp: ";
- for(i=0; i<Size; i++){
- temp = A[i];
- size = a.size();
- cout << "temp1: " << temp << " size: " << size << endl;
- for(j=0; j<size; j++){
- if(a[j] != temp){
- cout << "j = " << j << endl;
- a[j] = temp;
- cout << "a.at(" << j << "): " << a.at(j) << endl;
- }
- }
- }
- return a.size();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement