For this Question: Given a linked list consisting of N nodes, your task is to check if the given list is circular or not.

<b>Note: Sample Input and Output just show how a linked list will look depending on the questions. Do not copy-paste as it is in custom input</b><b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>check()</b> that takes the head node as a parameter.

<b>Note: 0 and 1 in sample input just show given LL is CLL or not. 1 denotes it is CLL, 0 denotes not</b>

Constraints:
1 <=N <= 1000
1 <= Node.data<= 1000

Return 1 if the given linked list is circular else return 0.Sample Input 1:-
3 0
1 2 3

Sample Output 1:-
0

Explanation:-
1->2->3

Sample Input 2:-
3 1
1 2 3

Sample Output 2:-
1

Explanation:-
1->2->3->1.......


, I have written this Solution Code:   public static int  check(Node head) {
 if (head == null) 
    return 1; 
   
    Node node = head.next; 
  
    while (node != null && node != head) 
    node = node.next; 
  
    if(node==head){return 1;}
    else {return 0;}
        
    }, In this Programming Language: Java, Now tell me if this Code is compilable or not?