Given an array of integers, find the largest possible product obtained by multiplying two adjacent numbers in an array.
Examples
adjac...
For further actions, you may consider blocking this person and/or reporting abuse
Rust
on stable you have the options of instead doing:
or
which produce identical assembly to each other in release mode (meaning the compiler proves different sized slices unreachable without your help)
Generic:
Haha square meters go brr
Golang solution
Python 3 oneliner with testcases and TIO link:
Try it online!
Perl
C
JS
Here is the simple solution in PHP:
A KISS version in typescript...
What counts as adjacent? Neighboring?
Like the tests, I'm gonna assume that this only takes 3 inputs.
But, Java:
JS
JS