All Questions
2 questions
4
votes
2
answers
452
views
Replace array element with multiplication of neighbors in Scala
Given an array of integers, update the index with multiplication of previous and next integers,
Input: 2 , 3, 4, 5, 6
Output: 2*3, 2*4, 3*5, 4*6, 5*6
Following ...
1
vote
1
answer
103
views
Check if list contains a pair which adds up to a given sum
Kindly review this scala code for given problem and suggest improvements.
Problem - Given an array of integers and a target sum, check if array contains a pair which adds up to sum.
Example -
<...