Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int max_win_length = 0;
- int max_loss_length = 0;
- for (int i=1; i <matchs.size(); i++){
- int win_length = 1;
- int loss_length = 1;
- if (matchs[i].status == "win"){
- if (matchs[i-1].status == match[i].status){
- win_length++;
- }
- else{
- win_length = 1;
- }
- }
- else if (matchs[i].status == "loss"){
- if (matchs[i-1].status == match[i].status){
- loss_length++;
- }
- else{
- loss_length = 1;
- }
- }
- max_win_length = Math.max(max_win_length, win_length);
- max_loss_length = Math.max(max_loss_length, loss_length);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement