findTripleOfSum

fun IntArray.findTripleOfSum(sum: Int): Triple<Int, Int, Int>?

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1..10).findTripleOfSum(6) // (1, 2, 3)

Since

1.1.0

See also


fun LongArray.findTripleOfSum(sum: Long): Triple<Long, Long, Long>?

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1..10L).findTripleOfSum(6L) // (1L, 2L, 3L)

Since

1.1.0

See also


fun FloatArray.findTripleOfSum(sum: Float): Triple<Float, Float, Float>?

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1F, 2F, 3F, 4F, 5F, 6F).findTripleOfSum(6F) // (1F, 2F, 3F)

Since

1.1.0

See also


fun DoubleArray.findTripleOfSum(sum: Double): Triple<Double, Double, Double>?

finds three numbers inside the Array from the given sum.

Example:

arrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).findTripleOfSum(6.0) // (1.0, 2.0, 3.0)

Since

1.1.0

See also


fun IntArray.findTripleOfSum(sum: Int): Triple<Int, Int, Int>?

finds three numbers inside the IntArray from the given sum.

Example:

intArrayOf(1..10).findTripleOfSum(6) // (1, 2, 3)

Since

1.1.0

See also


fun LongArray.findTripleOfSum(sum: Long): Triple<Long, Long, Long>?

finds three numbers inside the LongArray from the given sum.

Example:

longArrayOf(1..10L).findTripleOfSum(6L) // (1L, 2L, 3L)

Since

1.1.0

See also


fun FloatArray.findTripleOfSum(sum: Float): Triple<Float, Float, Float>?

finds three numbers inside the FloatArray from the given sum.

Example:

floatArrayOf(1F, 2F, 3F, 4F, 5F, 6F).findTripleOfSum(6F) // (1F, 2F, 3F)

Since

1.1.0

See also

floatArrayOf

fun DoubleArray.findTripleOfSum(sum: Double): Triple<Double, Double, Double>?

finds three numbers inside the DoubleArray from the given sum.

Example:

doubleArrayOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).findTripleOfSum(6.0) // (1.0, 2.0, 3.0)

Since

1.1.0

See also

doubleArrayOf

fun Iterable<Int>.findTripleOfSum(sum: Int): Triple<Int, Int, Int>?

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1..10).findTripleOfSum(6) // (1, 2, 3)

Since

1.1.0

See also


fun Iterable<Long>.findTripleOfSum(sum: Long): Triple<Long, Long, Long>?

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1..10L).findTripleOfSum(6L) // (1L, 2L, 3L)

Since

1.1.0

See also


fun Iterable<Float>.findTripleOfSum(sum: Float): Triple<Float, Float, Float>?

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1F, 2F, 3F, 4F, 5F, 6F).findTripleOfSum(6F) // (1F, 2F, 3F)

Since

1.1.0

See also


fun Iterable<Double>.findTripleOfSum(sum: Double): Triple<Double, Double, Double>?

finds three numbers inside the Iterable from the given sum.

Example:

listOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0).findTripleOfSum(6.0) // (1.0, 2.0, 3.0)

Since

1.1.0

See also