Skip to content
Snippets Groups Projects
Select Git revision
  • 1170feb5255f52a2836f55d7a35df4e1b48a7387
  • main default protected
2 results

training_wandb.py

Blame
  • listes-fusion.py 367 B
    def fusion(l1, l2):
    
    	res = []
    	i = 0
    	j = 0
    
    	while i < len(l1) and j < len(l2):
    		if l1[i] < l2[j]:
    			res.append(l1[i])
    			i += 1
    		else: 
    			res.append(l2[i])
    			j += 1
    
    	while i < len(l1):
    		res.append(l1[i])
    		i += 1
    
    	while j < len(l2):
    		res.append(l2[j])
    		j += 1
    
    	return res
    
    print(fusion([2, 2, 3], [0, 4, 5, 14, 20, 25]))
    # [0, 2, 2, 3, 4, 5, 14, 20, 25]