comefrom: <awangdev>636. Exclusive Time of Functions_1.java
code: public int[] exclusiveTime(int n, List<String> logs) {
          
          int[] rst = new int[n];
          Stack<Integer> stack = new Stack<>();
          int timestamp = 0;
          for (String log : logs) {
              String[] parts = log.split(":");
              int task = Integer.parseInt(parts[0]);
              boolean start = parts[1].equals("start");
              int time = Integer.parseInt(parts[2]);
              
              if (!stack.isEmpty()) rst[stack.peek()] += time - timestamp;
              timestamp = time;
              
              if (start) stack.push(task);
              else {
                  int endTask = stack.pop();
                  rst[endTask] += 1; 
                  timestamp++;
              }
          }
          return rst;
      }
masked: public int [ ] sample_funcname ( int var_0 , List < String > var_1 ) {
    int [ ] var_2 = new int [ var_0 ] ;
    Stack < Integer > var_3 = new Stack < > ( ) ;
    int var_4 = 0 ;
    for ( String var_5 : var_1 ) {
      String [ ] var_6 = var_5 . split ( ":" ) ;
      int var_7 = Integer . parseInt ( var_6 [ 0 ] ) ;
      boolean var_8 = var_6 [ 1 ] . equals ( "start" ) ;
      int var_9 = Integer . parseInt ( var_6 [ 2 ] ) ;
      if ( ! var_3 . isEmpty ( ) ) var_2 [ var_3 . peek ( ) ] += var_9 - var_4 ;
      var_4 = var_9 ;
      if ( var_8 ) var_3 . push ( var_7 ) ;
      else {
        int var_10 = var_3 . pop ( ) ;
        var_2 [ var_10 ] += 1 ;
        var_4 ++ ;
      }
    }
    return var_2 ;
  }
  