SRM479 Div2 Easy(250) TheAirTripDivTwo
#include <vector> using namespace std; class TheAirTripDivTwo { public: int find( vector <int> flights, int fuel ); }; int TheAirTripDivTwo::find( vector <int> flights, int fuel ) { int n = (int)flights.size(); for ( int i=0; i<n; i++ ) if ( ( fuel -= flights[i] ) < 0 ) return i; return n; }