Check whether jigsaw puzzle solveable or not | Java program for the above approach ; Function to check if the jigsaw Puzzle is solveable or not ; Base Case ; By placing the blank tabs as a chain ; Driver Code
import java . util . * ; class GFG { static void checkSolveable ( int n , int m ) { if ( n == 1 m == 1 ) System . out . print ( " YES " ) ; else if ( m == 2 && n == 2 ) System . out . print ( " YES " ) ; else System . out . print ( " NO " ) ; } public static void main ( String [ ] args ) { int n = 1 , m = 3 ; checkSolveable ( n , m ) ; } }