Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetWorkingDir %A_ScriptDir%
- FileRead, numStr, % A_ScriptDir "\d9.txt"
- length := 25
- numA := StrSplit(numStr, "`r`n")
- numAR := {}
- for i, j in numA {
- if !numAR[j]
- numAR[j] := {}
- numAR[j][i] := 1
- }
- for i, j in numA {
- if (i < length + 1)
- Continue
- count := 0
- ind := 0
- CurrentValue := j
- Loop, % length
- {
- ind += 1
- CheckedIndex := i - ind
- CheckedValue1 := numA[CheckedIndex]
- CheckedValue2 := CurrentValue - CheckedValue1
- if numAR[CheckedValue2] and (CheckedValue1 != CurrentValue / 2) {
- for k, l in numAR[CheckedValue2] {
- if (k < i) and (k > i - length){
- count += 1
- }
- }
- }
- }
- if (count = 0) {
- invalid := j
- Break
- }
- }
- for i, j in numA {
- sum := 0
- small=
- big=
- Loop
- {
- sum += numA[i + A_Index - 1]
- if (numA[i + A_Index - 1] < small) or !small
- small := numA[i + A_Index - 1]
- if (numA[i + A_Index - 1] > big) or !big
- big := numA[i + A_Index - 1]
- if (sum >= invalid) {
- last := numA[i + A_Index - 1]
- Break
- }
- }
- if (sum = invalid) {
- Clipboard := small + big
- Break
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment