copilot problematic
unknown
golang
2 years ago
466 B
7
Indexable
func unkownFunc(nrOfUnique int, sequence string) int { i := nrOfUnique - 1 for { if i >= len(sequence) { break } minIndex := i - nrOfUnique + 1 charBits := 1 << (uint32(sequence[i]) % 32) for j := i - 1; j >= minIndex; j-- { currCharBit := 1 << (uint32(sequence[j]) % 32) if charBits&currCharBit != 0 { i = j + nrOfUnique break } charBits = charBits | currCharBit if j == minIndex { return i + 1 } } } return -1 }
Editor is loading...