• + 0 comments

    I really don't understand what it wanted me to do. it doesn't complicate, but i have to research to understand that what it really wanted me to do

      // Write your code here
        arr := make([][]int32, n) 
        result:= make([]int32, 0)
        lastAnswer := int32(0);
        for _, query := range queries {
          qType := query[0]
          x := query[1]
          y := query[2]
          idx := (x ^ lastAnswer) % n
        if qType == 1 {
          arr[idx] = append(arr[idx], y)
        } else if qType == 2 {
          lastAnswer = arr[idx][y % int32(len(arr[idx]))]
          result = append(result, lastAnswer)
          }
        }
        return result