Will ROS be perfect for my purpose ? Help!

I am planning to visualize solving a problem that uses the backtracking algorithm.
So there will be a robot (which cleans room) that can move one grid at a time in a let’s say 10x10 grid. There are some obstacles and the robot uses a backtracking algorithm to clean the whole room.

There are some constraints on the robot. the robot can move one grid at a time. and can only go in up ,right ,left and down. and it can rotate in place by 90 degrees.

The courses are expensive. But if this particular scenario is possible then I am willing to invest.

The problem is actually a leetcode problem that I want to help visualize.

Given a robot cleaner in a room modeled as a grid.

Each cell in the grid can be empty or blocked.

The robot cleaner with 4 given APIs can move forward, turn left or turn right. Each turn it made is 90 degrees.

When it tries to move into a blocked cell, its bumper sensor detects the obstacle and it stays on the current cell.

Design an algorithm to clean the entire room using only the 4 given APIs shown below.

interface Robot {
// returns true if next cell is open and robot moves into the cell.
// returns false if next cell is obstacle and robot stays on the current cell.
boolean move();

// Robot will stay on the same cell after calling turnLeft/turnRight.
// Each turn will be 90 degrees.
void turnLeft();
void turnRight();

// Clean the current cell.
void clean();