class Solution {
public:
int fib(int n) {
int a = 0;
int b = 1;
int c = 0;
if(n < 2) return n==0?0:1;
for(int i = 1;i<n;i++)
{
c = (a+b)% 1000000007;
a = b;
b = c;
}
return b;
}
};
class Solution {
public:
vector<int> trainingPlan(vector<int>& actions) {
int i =0;
int j = actions.size()-1;
while(i < j)
{
while(i<j && actions[i]%2 == 1) i++;
while(i<j && actions[j]%2 == 0) j--;
int tmp = actions[i];
actions[i] = actions[j];
actions[j] = tmp;
}
return actions;
}
};