// note: using template here is completely unnecessary. this is just a demonstration of how to define a templated function. class Solution { public: template T removeElement(vector& nums, T val) { int size = nums.size(); int j = 0; for(int i=0;i