logo

Academy

DocumentationSubmit a solutionRepository structure

Code structure

Where the programming solutions are in the repository, and what each file of a challenge folder is for.

This page gives the structure of the code folder, and the purpose of each file in a challenge folder. Read it before you send your first programming solution.

The repository keeps the code solutions in this structure:

Structure

This folder stores the programming challenges.

code/
└── <site>/
    └── <challenge-id>/
        ├── LINK.lst
        ├── OTHERS.lst
        ├── DATA.lst
        ├── <gitlab-username>.<ext>    (solution file)
        └── <gitlab-username>.yml      (YAML file)

Example

code/
└── codeabbey/
    └── 135/
        ├── LINK.lst
        ├── OTHERS.lst
        ├── DATA.lst
        ├── friendglak.dart
        └── friendglak.yml

Steps

1. Rules

  • The name of a file or a folder must have 35 characters or less.
  • The name must be in lower case, and it must have no special character.
  • Use a dash (-) in place of a space.
  • Sometimes a folder name is already in use for a different category on the same platform. An example is two challenges with the same name in different categories. In that condition, add the category as a suffix after a dash: <name>-<category>. The full name must still have 35 characters or less. The commit message must say that the folder name has a category suffix, because of the name collision.

2. Files

The challenge folder holds the files below. You add a solution file and a YAML file with your GitLab username. The other three files belong to the challenge, and all the talents of that challenge share them.

  • LINK.lst. This file contains the URL of the challenge. It must have only one line. The URL must give an HTTP 200 response, with no redirection.

  • DATA.lst. This file contains the test cases of the challenge. Each test case must be in a format that a solution file can read directly. Only a challenge that gives test cases has this file.

  • OTHERS.lst. This file contains the external solutions of that challenge. Do not read them, and do not use them to solve the challenge. External solutions gives the rules of this file.

3. New challenge folders

You sometimes send the first solution of a challenge. Then you create the challenge folder, and you create LINK.lst and OTHERS.lst in it.

CAUTION: Your pipeline fails if the challenge folder has no LINK.lst, or if LINK.lst is empty. It also fails if the folder has no OTHERS.lst. Create an empty OTHERS.lst when the challenge has no external solution.

On this page