A personal collection of algorithm exercises written in Dart to practice logic, problem-solving, and clean code.
This repository is part of my journey to become a proficient Flutter & full-stack mobile developer. Each exercise is saved in a separate file with clean code, comments, and tested outputs.
Description: Finds the element that appears the most in a list of integers.
π File: exos_01_most_frequent_element.dart
Description: Returns the 2 highest values in a list without using sort()
.
π File: exos_02_two_largest_numbers.dart
Description: Detects the only missing number in a list of integers from 1 to N.
π File: exos_03_missing_number_in_consecutive_list.dart
Description: Returns a list of all prime numbers between 2 and N.
π File: exos_04_find_all_prime_numbers_up_to_n.dart
Description: Filters a list of integers and returns only those whose digits add up to an even number.
π File: exos_05_filter_even_digit_sums.dart
Description: Checks if a given string is a pangram, meaning it contains every letter of the alphabet at least once.
π File: exos_06_is_pangram.dart
Description: Returns all the keys in a Map
that are associated with a given value.
π File: exos_07_keys_by_value.dart
Description: Determines whether two strings are anagrams (same letters, different order, ignoring spaces and case).
π File: exos_08_anagram_checker.dart
Description: Groups a list of strings by word length into a Map<int, List<String>>
.
π File: exos_09_group_by_length.dart
Description: Finds the most common first letter in a list of words. In case of a tie, returns the one that comes first alphabetically.
π File: exos_10_most_common_first_letter.dart
Description: Finds the most frequent character (letter) in a string. Ignores case and non-letter characters.
π File: exos_11_most_frequent_letter.dart
Description: Groups a list of words into a Map<int, List<String>>
based on word length.
π File: exos_12_group_words_by_length.dart
Description: Counts how many words in a list start with a specific letter (case-insensitive).
π File: exos_13_count_words_starting_with.dart
Description: Returns the list of distinct letters that appear in both input strings (case-insensitive).
π File: exos_14_common_letters.dart
Description: Returns the sum of all integers in a list that appear only once.
π File: exos_15_sum_of_unique_values.dart
Description: Groups a list of words into a Map<String, List<String>>
based on their first letter (lowercase).
π File: exos_16_group_words_by_first_letter.dart
Description: Determines the most common word length in a list of words. In case of a tie, returns the smallest length.
π File: exos_17_most_frequent_word_length.dart
Description: Removes duplicate values from a list while keeping the original order of elements.
π File: exos_18_remove_duplicates_keep_order.dart
Description: Returns the length of the longest consecutive sequence of integers in an unsorted list.
π File: exos_19_longest_consecutive_sequence.dart
Description: Groups a list of words into a Map<String, List<String>>
based on their last letter (lowercase).
π File: exos_20_group_by_last_letter.dart
Description: Returns the most frequent number in a list. In case of a tie, returns the smallest one.
π File: exos_21_mode_from_list.dart
Description: Implements the insertion sort algorithm as an extension method on List<int>
.
π File: exos_22_insertion_sort_extension.dart
Description: Reverses the order of words in a given string while preserving word content.
π File: exos_23_reverse_words.dart
- Practice clean and readable Dart code.
- Build confidence in solving logic-based challenges.
- Prepare for technical interviews and app feature logic.
To run any exercise, make sure you have the Dart SDK installed.
Then open your terminal at the root of this project and run:
dart exos/exos_01_most_frequent_element.dart
| # | Exercise Title | Description |
|----|---------------------------------------------|-------------|
| 01 | Find the most frequent element | Finds the element that appears the most in a list of integers. |
| 02 | Find the two largest numbers | Returns the 2 highest values in a list without using `sort()`. |
| 03 | Find the missing number in a list | Detects the only missing number in a list of integers from 1 to N. |
| 04 | Find all prime numbers up to N | Returns a list of all prime numbers between 2 and N. |
| 05 | Filter integers with even digit sums | Filters integers whose digits add up to an even number. |
| 06 | Is Pangram | Checks if a string contains every letter of the alphabet at least once. |
| 07 | Keys by Value in a Map | Returns all keys associated with a given value in a `Map`. |
| 08 | Anagram Checker | Checks if two strings are anagrams (same letters, different order). |
| 09 | Group Words by Length | Groups words by their length into a `Map<int, List<String>>`. |
| 10 | Most common first letter | Finds the most common first letter in a list of words. |
| 11 | Most frequent letter | Finds the most frequent letter in a string (ignores case and non-letters). |
| 12 | Group words by length | Groups words into a `Map<int, List<String>>` based on length. |
| 13 | Count words starting with a letter | Counts how many words start with a specific letter. |
| 14 | Common letters between two strings | Returns distinct letters appearing in both strings. |
| 15 | Sum of unique values | Sums all integers that appear only once in a list. |
| 16 | Group words by first letter | Groups words into a `Map<String, List<String>>` based on their first letter. |
| 17 | Most frequent word length | Finds the most common word length in a list. |
| 18 | Remove duplicates (keep order) | Removes duplicates from a list while keeping order. |
| 19 | Longest consecutive sequence | Finds the length of the longest consecutive sequence of integers. |
| 20 | Group words by last letter | Groups words into a `Map<String, List<String>>` based on their last letter. |
| 21 | Find the mode from a list | Finds the most frequent number in a list (smallest if tie). |
| 22 | Insertion sort extension | Implements insertion sort as an extension on `List<int>`. |
| 23 | Reverse words in a string | Reverses the order of words in a given string. |