mirror of
				https://github.com/onyx-and-iris/aoc2023.git
				synced 2025-10-31 12:51:49 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			9ba5ad695e
			...
			0f357df19d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0f357df19d | |||
| 5b225a9166 | 
| @ -16,8 +16,9 @@ type bound struct { | ||||
| } | ||||
| 
 | ||||
| // newBound returns a bound type | ||||
| // it defines an open ended interval | ||||
| func newBound(lower, upper int) bound { | ||||
| 	return bound{lower: lower, upper: upper} | ||||
| 	return bound{lower: lower, upper: upper - 1} | ||||
| } | ||||
| 
 | ||||
| // nextTransform recursively calculates each new set of seed ranges for each set of data in dataMap | ||||
| @ -42,10 +43,10 @@ func nextTransform(i int, in []bound) []bound { | ||||
| 
 | ||||
| 					// append unmatched portions of seed range back into queue | ||||
| 					if start > r.lower { | ||||
| 						q.enqueue(newBound(r.lower, start-1)) | ||||
| 						q.enqueue(newBound(r.lower, start)) | ||||
| 					} | ||||
| 					if r.upper > end { | ||||
| 						q.enqueue(newBound(end, r.upper-1)) | ||||
| 						q.enqueue(newBound(end, r.upper)) | ||||
| 					} | ||||
| 					return true | ||||
| 				} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user