Post

Replies

Boosts

Views

Created

Higher Order Function
Hi there, I have the following problem, I want to get the pair of given sum by using higher order functions. I am able to do this using iterative approach. Can someone help me to solve the problem using higher order function. let array = [1,2,3,4] let givenSum = 5 for i in 0..<array.count {   let j = i + 1   for j in j..<array.count {     if array[i] + array[j] == givenNum {       print("Pair : \(array[i]),\(array[j])")     }   } } The output is [2,3] Any help is appreciated. Thank you
4
0
718
Oct ’22
Storekit2
Hi Everyone, Does storekit2 supports reedeming promotional offer codes and discounts?
Replies
0
Boosts
0
Views
795
Activity
Nov ’22
Camera zoom level
Is it possible to get the camera zoom level on various device models in iPhone like in builtin camera programmatically example 0.5x, 1x, 2x buttons etc?
Replies
2
Boosts
0
Views
3.9k
Activity
Nov ’22
Higher Order Function
Hi there, I have the following problem, I want to get the pair of given sum by using higher order functions. I am able to do this using iterative approach. Can someone help me to solve the problem using higher order function. let array = [1,2,3,4] let givenSum = 5 for i in 0..<array.count {   let j = i + 1   for j in j..<array.count {     if array[i] + array[j] == givenNum {       print("Pair : \(array[i]),\(array[j])")     }   } } The output is [2,3] Any help is appreciated. Thank you
Replies
4
Boosts
0
Views
718
Activity
Oct ’22