The 8-puzzle problem is a puzzle invented and popularized by Noyes Palmer Chapman in the 1870s. It is played on a 3-by-3 grid with 8 square blocks labeled 1 through 8 and a blank square. Your goal is to rearrange the blocks so that they are in order or reach the goal state.
Uncomment this line to put in custom goal state
# print("Enter the Goal state")
# for i in range (9):
# goal.append(int(input()))
#for ideal goal state