尝试在另一个集合中设置路径变量:
seq = "ATGTGCAAGAATGAGGCAAG$" #original string
array = [20, 17, 6, 9, 18, 7, 13, 10, 0, 16, 5, 19, 8, 12, 15, 4, 14, 2, 11, 3, 1] #suffix array
def bisect_left(array, query, seq, lo=0, hi=None):
if lo < 0:
raise ValueError('must be non-negative')
if hi is None: #by default len(array)
hi = len(array)
while lo < hi:
mid = (lo+hi)//2 #set the middle to binary search
if seq[array[mid]:] < query:
lo = mid+1
else:
hi = mid
def match_at(i):
return seq[i: i + len(query)] == query
if not match_at(array[lo]):
raise IndexError('there is not any index for the query')
# array[lo] is one match
# now we walk backwards to find the first match
first = lo
while first > 0 and match_at(array[first - 1]):
first -= 1
# and walk forwards to find the last match
last = lo
while match_at(array[last]):
last += 1
return array[first:last]
print(bisect_left(array, 'ATG', seq))
这是$e = Get-Content c:\path\foo.txt
$f = "$e\folder\folder"
稍后尝试
robocopy
对此有何想法或建议?