So I have an array t and an array x. I'm trying to find the pattern "abc" of the array t inside the array x, which is at index 5 of the array. I've written this code so far but am lost as to why this is not working...

Also, I'm not allowed to use anything else but *while !=* or *while ==* in my code, making it a tad trickier. (Would've used a simple for loop otherwise).

Any ideas?

```
public static void main(String[] args){

  char t[]={'a','b','c'};
  char x[]={'e','a','b','x','c','a','b','c'};
  int i=0, j=0, c=0;
  boolean a = false;
  while(i != x.length){
      if(t[0]!= x[i]){
          i++;
          continue;
      }
      else{
          j=0;
          while(j != t.length){
              if(t[j]==x[i+j])
              c++; j++;
          }
      if(c==t.length){
         a = true;
          break;
      }
      else{
          i=i+c-1;    
          c=0;
      }
  }
  if (a == true)
  System.out.println("index: "+i); 
  else
  System.out.println("Match not found");

  }
}

```