Pancake Sorting

On submission, 3 out of 7 test cases are not working.
Please help.
Here is my code-

Code and submit with the same approach on https://leetcode.com/problems/pancake-sorting/ to check.
There are test case issues with this question.
Let me know if your approach gives wrong answer even on Leetcode

My code is giving a compilation error in leetcode. I tried a lot resolving it, but I cannot find the error.
This is the error-
Line 58: Char 25: error: use of undeclared identifier ‘Solution’
vector ret = Solution().pancakeSort(param_1); return ret;
^

Please share your leetcode code.

You can follow this approach
Input: [3,2,4,1]
Pick highest element so far. Do swaps to bring it to last position.
In the input ,4 is the highest. So subarray from 3 to 4 is reversed.
Swap 1: 4 2 3 1
The whole array is then reversed such that 4 reaches its desired position.
Swap 2: 1 3 2 4
Now the unsorted window is from index 0 to 2.Highest element in this window is 3.So subarray 1 3 is reversed
Swap 3: 3 1 2 4
Swap the whole window such that 3 reaches its desired position.
Swap 4: 2 1 3 4
Now the unsorted window is from index 0 to 1. Highest element in this window is 2.
Swap 5:1 2 3 4

Reference code https://ide.codingblocks.com/s/302213

I did the exact same thing. Still some of the test cases are not working.

The code which you have shared is not of pancake sort. Please check.
Also, as i said there are test case issues with this question. So follow the same approach and code it on leetcode to check if it passes all the test case

Got accepted on Leetcode. Thank You