Help me in solving LBJ17 problem

My issue

import java.util.Scanner;

class Codechef
{
public static void main (String args)
{
Scanner read = new Scanner(System.in);

	int t = read.nextInt();
	for(int i=0; i<t; i++)
	{
		int x = read.nextInt();
		int y = read.nextInt();
		int a= y/10;
		int b= (x/10) +1;
		if( x!=y && a>=b)
		{
		    System.out.println(a-b);
		}
		else{
		    System.out.println(b-a);
		}
		
	}
}

}

My code

// Update the code below to solve this problem
import java.util.Scanner;

class Codechef
{
	public static void main (String[] args)
	{
		Scanner read = new Scanner(System.in);
		
		int t = read.nextInt();
		for(int i=0; i<t; i++)
		{
    		int x = read.nextInt();
    		int y = read.nextInt();
    		int a= y/10;
    		int b= (x/10) +1;
    		if( x!=y && a>=b)
    		{
    		    System.out.println(a-b);
    		}
    		else{
    		    System.out.println(b-a);
    		}
    		
		}
	}
}

Learning course: Solve Programming problems using Java
Problem Link: CodeChef: Practical coding for everyone

@meeraa
U are making mistakes for some edge cases .
plzz refer the following solution for better understanding of the logic and implementation.

// Update the code below to solve this problem
import java.util.Scanner;
import java.lang.Math;

class Codechef
{
	public static void main (String[] args)
	{
		Scanner read = new Scanner(System.in);
		
		int t = read.nextInt();
		for(int i=0; i<t; i++)
		{
    		int x = read.nextInt();
    		int y = read.nextInt();
    		double x1=Math.ceil((double)x/10);
    		double y1=Math.ceil((double)y/(double)10);
    		x=(int)x1;
    		y=(int)y1;
    		System.out.println(Math.abs(x-y));
		}
	}
}