排期current后,h1b renew 可以多于一年# EB23 - 劳工卡
a*o
1 楼
大家讨论一下,目前只想到brute force, 从length=1开始
看看每个是不是在subarray里面,事先可以把长度为length的subarray放到
一个hash table里面
Find shortest array (S), with all elements 0 <= S[i] <= X, that is not
subarray (Subarray has to be in same order, but not necessary consecutive)
of the given array A.
For example:
A = [0, 1, 0, 2, 0, 2]
X = 2
Solution is either [1, 1] or [2, 1]
X = 1
A = [0, 0, 1, 1, 0, 1]
Soluti is [1,0,0]
看看每个是不是在subarray里面,事先可以把长度为length的subarray放到
一个hash table里面
Find shortest array (S), with all elements 0 <= S[i] <= X, that is not
subarray (Subarray has to be in same order, but not necessary consecutive)
of the given array A.
For example:
A = [0, 1, 0, 2, 0, 2]
X = 2
Solution is either [1, 1] or [2, 1]
X = 1
A = [0, 0, 1, 1, 0, 1]
Soluti is [1,0,0]