Advertisement
Merevoli

Untitled

Dec 12th, 2021
511
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int max_win_length = 0;
  2. int max_loss_length = 0;
  3.  
  4. for (int i=1; i <matchs.size(); i++){
  5.     int win_length = 1;
  6.     int loss_length = 1;
  7.  
  8.     if (matchs[i].status == "win"){
  9.         if (matchs[i-1].status == match[i].status){
  10.             win_length++;
  11.         }
  12.         else{
  13.             win_length = 1;
  14.         }
  15.     }
  16.     else if (matchs[i].status == "loss"){
  17.         if (matchs[i-1].status == match[i].status){
  18.             loss_length++;
  19.         }
  20.         else{
  21.             loss_length = 1;
  22.         }
  23.     }
  24.  
  25.     max_win_length = Math.max(max_win_length, win_length);
  26.     max_loss_length = Math.max(max_loss_length, loss_length);
  27.    
  28. }
Advertisement
RAW Paste Data Copied
Advertisement