Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. List<int> winningNumbers = [12, 6, 34, 22, 41, 9];
  2.  
  3.  
  4. void main() {
  5.  
  6. List<int> ticket1 = [45, 2, 9, 18, 12, 33];
  7. List<int> ticket2 = [41, 17, 26, 32, 7, 35];
  8.  
  9.  
  10. checkNumbers(ticket1);
  11.  
  12. }
  13.  
  14. void checkNumbers(List<int> myNumbers) {
  15. int i=0;
  16. //Write your code here.
  17. for(int match in myNumbers){
  18. for(int winningNum in winningNumbers){
  19. if(match == winningNum){
  20. i++;
  21. }
  22. }
  23.  
  24.  
  25.  
  26. }
  27. print('matches $i times');
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement