A = [ 2, 4, 5, 7 ]. B = [ 1, 2, 6, 7]. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

A = [ 2, 4, 5, 7 ]. B = [ 1, 2, 6, 7].

Create a program to determine a smallest positive integer (not zero), which not included in both array variable! Do you mind helping me a little bit guys? Thank you

11th Sep 2019, 11:24 AM
Radendy Bahtiar
Radendy Bahtiar - avatar
2 Respostas
+ 3
I can think of this: 1. iterate from 1 to infinity 1.1. Check membership of A 1.2. If false, check membership of B 1.3. If false, you're done. Else, repeat.
11th Sep 2019, 11:26 AM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar
0
Very helpful. Thank you man
11th Sep 2019, 11:40 AM
Radendy Bahtiar
Radendy Bahtiar - avatar