As stated here, the Go code for the Stock Exchange Losses puzzle seems unable to handle the large amount of input data given in example 5:
scanner := bufio.NewScanner(os.Stdin)
var n int
scanner.Scan()
fmt.Sscan(scanner.Text(),&n)
fmt.Fprintln(os.Stderr, "Count of data points:", n)
scanner.Scan()
text := scanner.Text()
fmt.Fprintln(os.Stderr, "Full input text received:", text)
inputs := strings.Split(text, " ")
fmt.Fprintln(os.Stderr, "Count of actual inputs:", len(inputs))
fmt.Fprintln(os.Stderr, "Actual inputs:", inputs)
Which outputs this for example 2:
Count of data points: 6
Full input text received: 5 3 4 2 3 1
Count of actual inputs: 6
Actual inputs: [5 3 4 2 3 1]
And this for example 5:
Count of data points: 99999
Full input text received:
Count of actual inputs: 1
Actual inputs: []
This is not true in javascript, where all the input data for example 5 is read correctly