mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			376 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			376 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
| func anyCommonElements <T, U where T: Sequence, U: Sequence, T.GeneratorType.Element: Equatable, T.GeneratorType.Element == U.GeneratorType.Element> (lhs: T, rhs: U) -> Bool {
 | |
|     for lhsItem in lhs {
 | |
|         for rhsItem in rhs {
 | |
|             if lhsItem == rhsItem {
 | |
|                 return true
 | |
|             }
 | |
|         }
 | |
|     }
 | |
|    return false
 | |
| }
 | |
| anyCommonElements([1, 2, 3], [3])
 |