12 for num in $(<input.txt); do
13 cur_line=$((cur_line+1))
14 windows[$cur_window]=$num
15 if [ $cur_window -gt 1 ]; then
16 ((windows[$((cur_window - 1))]+=$num))
18 if [ $cur_window -gt 2 ]; then
19 ((windows[$((cur_window - 2))]+=$num))
32 if [ $cur_number -gt $prev_number ]; then
40 # remove last 2 entries for windows array
41 unset windows[$((cur_window+1))]
42 unset windows[$((cur_window+2))]
44 echo "$count is the answer"
46 # start from window 2, then we just compare to previous
50 while [ $window -le ${#windows[@]} ]; do
51 if [ ${windows[$((window-1))]} -lt ${windows[$window]} ]; then
57 echo "$count is the 3 value sum answer"