loading...
Github Test
Travel through Emporia
Imagine a world all your own. A place that you own, where you can build what you want, farm what you want, and build your own empire, welcome to Emporia!

Bastian Alcatraz, a commander of Warena, explores the new world of Warena called Emporia, a DeFi land of Warena. His job is to visit everywhere in Emporia and report back to his boss after his journey. Let’s help Bastian calculate all the possible ways to traverse the Emporia without missing any place and each empty place is only visited once.
Input format
  • The first line will contain m and n, the # of rows and columns, respectively
  • Following that will be m lines and there are n digits for each line, separated by spaces.
  • Each digit on each line could be 0, 1, 2, 3
    • 2 indicates the place Bastian will start his journey
    • 3 indicates the place Bastian will finish his journey in Emporia.
    • 0 indicates an empty place that Bastian can move to.
    • 1 indicates an obstacle that Bastian can not move to.
  • The input data will be provided from stdin.
Output format

A single number, the # of the ways Bastian can travel from the start to the destination, not missing any empty places in Emporia.

Example

Sample Input:
Sample Input:

Explanation

In this case, the Emporia map is a matrix of 4 by 4 and there are 2 obstacles at (0, 1) and (0,2). The start place and destination place are at (0,3) and (0,0). After the calculation, Bastian found 4 different ways to traverse from 2 to 3.

Submission

  • Send us your resume together with the solution to contact@codelight.co. We are accepting the solution written in python, rust, golang, javascript, and typescript but you are welcome to use any language to solve as you would like.
  • For example, if you are using Java to solve the challenge, send us emporia.java; if you are using python, then send us emporia.py.
  • If you have any question, ask us in discord at: https://discord.gg/h8x263RPK6
Got questions?
Send us a message on Discord. We'll get back to you real quick