Added helper for vector-stats
This commit is contained in:
		
							parent
							
								
									5ea6d1f975
								
							
						
					
					
						commit
						bbd9623256
					
				
							
								
								
									
										15
									
								
								helper/vector-stats.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								helper/vector-stats.hpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					#ifndef C437A277_1F23_496D_9B69_A21D771ECA91
 | 
				
			||||||
 | 
					#define C437A277_1F23_496D_9B69_A21D771ECA91
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <vector>
 | 
				
			||||||
 | 
					#include <limits.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int max(std::vector<int> vec){
 | 
				
			||||||
 | 
					    int max = INT_MIN;
 | 
				
			||||||
 | 
					    for(int i=0; i<vec.size(); ++i){
 | 
				
			||||||
 | 
					        if(vec[i] > max) max = vec[i];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return max;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif /* C437A277_1F23_496D_9B69_A21D771ECA91 */
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user