Given an integer array nums and an integer target, remove al…
Given an integer array nums and an integer target, remove all elements greater than target in nums in-place}The order of the elements may be changed. Then return the number of elements in nums which are less than or equal to target. Example: given a vector nums={7,1,4,8,2,6,3} and target=5, the return value should be 5 (as the resultant array would be {1,4,2,3,5}). #include #include int removeGreaterThan(std::vector& nums, int target) { //to do….. return writeIndex;}