从原始序列中删除一些元素最少的删除的方法,怎么用C语言的程序的编写的设计的方法怎么来实现的

Problem Description
Haven't you heard about Lost?
Having written a article named , Lost is good at solved by algorithm problems(?). One day, GXX asked Lost to work out the Longest Increasing Subsequence(for short, LIS) of a given sequence {A_1, A_2, ..., A_N}. Knowing this problem well, Lost simply copied a program from his article and solved the problem in seconds. So that GXX became frustrated. She wanted to cheat Lost by removing some elements from the original sequence to make Lost's answer go wrong. For convinience, she would like to remove least number of elements.

Input
The beginning of the input is an integer T(T <= 10), which is the number of test cases. T cases are followed. The first line of each test case is an integer N (1 <= N <= 1,000), which denotes the length of the sequence. The second line is N integer A_1, A_2, ..., A_N, which denote the given sequence.

Output
For each test case, print a line contains a single integer which is the minimum number of the removed elements.

Sample Input
1
6
10 10 20 1 2 2

Sample Output
2

可以建一个数组计数,最后数组内数据比较吧