using namespace std;
#include<iostream>
#include<vector>
#include<algorithm>

#define Array vector

#define println(data) cout << data << endl

#define printArray(ary) \
			cout << "[ "; \
			for(int i = 0; i< (int)ary.size(); i++) \
				cout << ary[i] << " "; \
			cout << "]" << endl

#define sortArray(ary) sort(ary.begin(), ary.end())
#define reverseArray(ary) reverse(ary.begin(), ary.end())
#define copyArray(source, target) target.assign(source.begin(), source.end())
#define insertArray(ary, position, data) ary.insert(ary.begin() + position, data)
#define setArray(ary) ary.erase(unique(ary.begin(), ary.end()),ary.end())
#define isInArray(ary, data) find(ary.begin(), ary.end(), data) != ary.end() 
#define removeChar(strr, chr) strr.erase(remove(strr.begin(), strr.end(), chr), strr.end())

int main() {
	Array <int> ary1 = { 8, 4, 3, 1, 3, 7, 7, 4, 6, 3, 1, 1, 9 };
	Array <int> ary2;

	sortArray(ary1);
	printArray(ary1);

	reverseArray(ary1);
	printArray(ary1);

	copyArray(ary1, ary2);
	printArray(ary2);

	insertArray(ary1, 2, 8888);
	printArray(ary1);

	setArray(ary1);
	printArray(ary1);

	bool yn = isInArray(ary1, 8888);
	println(yn);

	string myStr = "IT CookBook Algorithm";
	removeChar(myStr, 'o');
	println(myStr);
}