Instruction - Please read the problem description then create a program to solve the problem. - For the solution, you should use at least Java 1.8 - There is no requirement for visualization, the console output specified below is enough. - Please include instructions on how to run your application in a README file in the root directory. - Your application must run and generate the correct result. - We expect the exercise to take around 2 to 6 hours to complete. - Through this exercise we evaluate a number of things including the design of your solution and your programming skills. - Either compress your files into a single Zip or GZip archive and send via email or store your code in a repositories and give us the access right. The Christmas gift collection It’s Boxing-day, at the local bar you see a person that looks familiar, with a large beard and a red coat, you realise that it’s Santa. Santa seems busy chatting with the bartender so you sneak up to a spot nearby to listen in on the conversation. Santa tells the bartender about the disaster that happened last night. Somewhere over Sydney, the bag of Christmas gifts broke and the Christmas gifts are now scattered all over town. You quickly map up Sydney in a grid and make a plan of attack to try to find the gifts. A robot, given a set of instructions, is the obvious collector of the gifts. With a list of movements, up, down, left and right ( U , D , L , R ) the robot walks the city in the hunt for gifts. Given a dimension n of the grid. (The robot cannot walk outside off the grid) Given a starting position (x, y). (Top left corner is (x: 0, y: 0) ) Given a list of positions of gifts (x, y)(x, y)(x, y) Given a list of instructions ( U D L R ) Your task is to program the robot to take an input in the given format and output the number of gifts found where the robot can be found. Example input: 4 0,0 0,1 1,2 2,0 3,2 DDRDRUUU Example output: 3 presents Robot can be found at (2, 0)
Stars
1
Forks
0
Watchers
1
Open Issues
0
Overall repository health assessment
No package.json found
This might not be a Node.js project
13
commits