mercredi 27 octobre 2021

How to divide all element in list at once :: DART

_num.sort();
List<int> _answer = [];

for (int i = 1; i <= _num.last; i++) {
  // help me pls 
  if (_num % i == 0) {
  }

i'm trying to do Greatest common divisor code but i don't know how to check if int i can divide all items in the list at once and remainder == 0

  • If there is a better way to do this please tell me, thank you

Aucun commentaire:

Enregistrer un commentaire