# LeetCode Difficulty Prediction from Solution Descriptions

*English translation by SOTA – AI Community of the Russian original. Licensed CC BY-NC-SA 4.0, like the original. Organisers who would like this translation removed can email sota.ai.community@gmail.com.*

*Contest 3 (28 June 2025) of the Kazakhstan IOAI Team Selection Test (Отборочные на IOAI), 2025. This is the Overview tab of the Kaggle competition "TST Day3 Upsolving", the host's public upsolving copy of the contest, open from 28 June to 15 July 2025. Its subtitle reads: "Classifying the difficulty of algorithmic problems from a step-by-step text description". Original: [kaggle.com/competitions/tst-day-3-upsolving](https://www.kaggle.com/competitions/tst-day-3-upsolving). The Data tab is translated in a separate file.*

## Overview

## 🧠 Predicting the difficulty of LeetCode problems from a text description of the solution

In this competition you are to build a model that, from a step-by-step **text description of a Python solution**, predicts how difficult the original LeetCode problem was:
**`easy`**, **`medium`** or **`hard`**.

Each solution is presented as a **human-readable step-by-step description** of the algorithm, without code or names of functions and variables.

## Description

### 📌 What is the input?

Each solution is presented as a **step-by-step text description of the algorithm**, written in natural language. Instead of the source code, you receive a short explanation of how the solution works.

Example:

```
- Initialize m and n as the lengths of the input string s and pattern p.  
- Use a while loop with condition i < m.  
- If the characters match or pattern has '?', move both pointers.  
- If '*', record positions and try to match the remainder.  
- Return true if pattern ends correctly.
```

🧠 Your task is to predict from such a description how **difficult** the problem to which this solution belongs was:

* `easy`
* `medium`
* `hard`

## Evaluation

## 🏆 Evaluation

The quality of solutions is evaluated by **F1** on a hidden test set:

* 50% of the examples are used for the **public** leaderboard
* 50% are used for the **private** leaderboard, which determines the final placings

---

## 📌 Rules

* Any models may be used: from logistic regression to transformers
