SimpleDuplicateRemover
SRM 274 · 2005-11-23 · by Andrew_Lazarev
SRM 274 · 2005-11-23 · by Andrew_Lazarev · Brute Force
Problem Statement
Problem Statement
We have a sequence of integers. We want to remove duplicate elements from it.
You will be given a
Constraints
- sequence will have between 1 and 50 elements, inclusive.
- Each element of sequence will be between 1 and 1000, inclusive.
Examples
0)
{1,5,5,1,6,1}
Returns: {5, 6, 1 }
We left the third 1, the second 2 and the only 6.
1)
{2,4,2,4,4}
Returns: {2, 4 }
2)
{6,6,6,6,6,6}
Returns: {6 }
3)
{1,2,3,4,2,2,3}
Returns: {1, 4, 2, 3 }
4)
{100,100,100,99,99,99,100,100,100}
Returns: {99, 100 }
Submissions are judged against all 72 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Coding Area
Language: C++17 · define a public class SimpleDuplicateRemover with a public method vector<int> process(vector<int> sequence) · 72 test cases · 2 s / 256 MB per case