Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<int> winningNumbers = [12, 6, 34, 22, 41, 9];
- void main() {
- List<int> ticket1 = [45, 2, 9, 18, 12, 33];
- List<int> ticket2 = [41, 17, 26, 32, 7, 35];
- checkNumbers(ticket1);
- }
- void checkNumbers(List<int> myNumbers) {
- int i=0;
- //Write your code here.
- for(int match in myNumbers){
- for(int winningNum in winningNumbers){
- if(match == winningNum){
- i++;
- }
- }
- }
- print('matches $i times');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement