mirror of
				https://github.com/autistic-symposium/master-algorithms-py.git
				synced 2025-10-30 13:49:02 -04:00 
			
		
		
		
	Update pascal_triangle.py
This commit is contained in:
		
							parent
							
								
									9a820d8599
								
							
						
					
					
						commit
						3d8721aaeb
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -3,11 +3,11 @@ | |||
| # author: bt3gl | ||||
| 
 | ||||
| 
 | ||||
| def get_row(self, irow: int) -> list[int]: | ||||
| def get_row(self, row: int) -> list[int]: | ||||
|          | ||||
|         if irow == 0:  | ||||
|         if row == 0:  | ||||
|             return [1] | ||||
| 	 | ||||
|         result = self.get_row(irow - 1) | ||||
|         result = self.get_row(row - 1) | ||||
|          | ||||
|         return [1] + [sum(_) for _ in zip(result, result[1:])] + [1] | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 marina
						marina