Every exercise that can appear in the 42 Common Core Exam Rank 02 β solved, explained, and organized by level.
Each exercise ships with its original subject, a bilingual explanation (π¬π§ English / πͺπΈ Spanish), and a clean C solution written from scratch.
This repository gathers all 56 functions and programs that may show up in Exam Rank 02 of the 42 Common Core, grouped by the four difficulty levels of the exam.
Every solution is written by me. If you are a 42 student, the best way to use this repo is simple: read the subject, try to solve it yourself, and only then compare. The goal is to learn the patterns β not to memorize answers.
β οΈ The real exam runs in a closed environment and grades you with the Moulinette. Use these solutions to understand, not to copy.
The exam has 4 levels of increasing difficulty. Each exercise lives in its own folder:
Level_X/
βββ exercise_name/
βββ README.md # Original subject (English)
βββ spanish.md # Explanation in Spanish πͺπΈ
βββ exercise.c # My solution
| Level 1 π« | Level 2 π« | Level 3 π« | Level 4 π« |
|---|---|---|---|
| β first_word | β alpha_mirror | β add_prime_sum | β flood_fill |
| β fizzbuzz | β camel_to_snake | β epur_str | β fprime |
| β putstr | β do_op | β expand_str | β ft_itoa |
| β ft_strcpy | β ft_atoi | β ft_atoi_base | β ft_list_foreach |
| β ft_strlen | β ft_strcmp | β ft_list_size | β ft_list_remove_if |
| β ft_swap | β ft_strcspn | β ft_range | β ft_split |
| β repeat_alpha | β ft_strdup | β ft_rrange | β rev_wstr |
| β rev_print | β ft_strpbrk | β hidenp | β rostring |
| β rot_13 | β ft_strrev | β lcm | β sort_int_tab |
| β rotone | β ft_strspn | β paramsum | β sort_list |
| β search_and_replace | β is_power_of_2 | β pgcd | |
| β ulstr | β last_word | β print_hex | |
| β max | β rstr_capitalizer | ||
| β print_bits | β str_capitalizer | ||
| β reverse_bits | β tab_mult | ||
| β snake_to_camel | |||
| β swap_bits | |||
| β union | |||
| β wdmatch |
π― Total pool: 56 functions / programs β 12 (L1) Β· 19 (L2) Β· 15 (L3) Β· 10 (L4)
- Pick an exercise and open its
README.mdto read the subject. - Solve it yourself first. Build with the flags the exam uses:
cc -Wall -Wextra -Werror your_solution.c
- Compare your version with the provided solution and understand the differences.
Train under real conditions:
- π₯οΈ 42 Exam Simulator (JCluzet) β recreates the exam environment locally.
- π§ͺ Grademe β online grader for individual exercises.
Found a bug, a cleaner approach, or a missing edge case? Contributions are welcome β open an issue or a pull request.
Released under the MIT License β free to use, learn from, and share.
If this repo helped you pass, consider leaving a β β it helps other students find it.
Made with β and a lot of -Wall -Wextra -Werror by Alex Higuera