Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions string_2/adjacent-vowels/description.md

This file was deleted.

43 changes: 0 additions & 43 deletions string_2/adjacent-vowels/io.json

This file was deleted.

10 changes: 0 additions & 10 deletions string_2/adjacent-vowels/meta.json

This file was deleted.

2 changes: 0 additions & 2 deletions string_2/adjacent-vowels/starter.py

This file was deleted.

2 changes: 1 addition & 1 deletion string_2/camel-to-snake/description.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Write a function `camel_to_snake(s: str) -> str` that converts a camelCase string into a snake_case string.

In camelCase, each word after the first starts with an uppercase letter (e.g., "thisIsFun"). In snake_case, words are all lowercase and separated by underscores (e.g., "this_is_fun").
In camelCase, each word after the first starts with an uppercase letter ("thisIsFun"). In snake_case, words are all lowercase and separated by underscores ("this_is_fun").

For example:
- `camel_to_snake("thisIsFun")` → `"this_is_fun"`
Expand Down
4 changes: 4 additions & 0 deletions string_2/camel-to-snake/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,9 @@
{
"input": ["noChangeNeeded"],
"output": "no_change_needed"
},
{
"input": ["XMLHttpRequestJSONParser"],
"output": "x_m_l_http_request_j_s_o_n_parser"
}
]
4 changes: 3 additions & 1 deletion string_2/camel-to-snake/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def camel_to_snake(s: str) -> str:
def camel_to_snake(s: str) -> str:
# Your code here
pass
12 changes: 12 additions & 0 deletions string_2/censor-word/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,17 @@
{
"input": ["", "word"],
"output": ""
},
{
"input": ["bad,bad! bad?", "bad"],
"output": "***,***! ***?"
},
{
"input": ["test test", "test"],
"output": "**** ****"
},
{
"input": ["test", ""],
"output": "test"

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a test for an empty word (expects the input string unchanged). Since "" is a tricky edge case for many implementations, the problem description should explicitly document the expected behavior when word is empty.

Suggested change
"output": "test"
"output": "test"
},
{
"input": ["leave this unchanged", ""],
"output": "leave this unchanged"

Copilot uses AI. Check for mistakes.
}
]
4 changes: 3 additions & 1 deletion string_2/censor-word/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def censor_word(s: str, word: str) -> str:
def censor_word(s: str, word: str) -> str:
# Your code here
pass
4 changes: 2 additions & 2 deletions string_2/contains-code-like/description.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Write a function `contains_code_like(s)` that takes a string `s` and returns `True` if the string contains the word "code" with any character in place of the third character. Specifically, the function should return `True` if anywhere in the string `s` there is a substring that matches the pattern "co?e", where `?` stands for any single character.
Write a function `contains_code_like(s: str) -> bool` that takes a string `s` and returns `True` if the string contains the word "code" with any character in place of the third character. Specifically, the function should return `True` if anywhere in the string `s` there is a substring that matches the pattern "co?e", where `?` stands for any single character.

For example:
- `contains_code_like("I love to decode")` should return `True` because it contains "code".
- `contains_code_like("coding and cobe")` should return `True` because it contains "cobe" (which fits the pattern).
- `contains_code_like("coding and cobe")` should return `True` because it contains "cobe".
- `contains_code_like("cofe is life")` should return `True` because it contains "cofe".
- `contains_code_like("cone")` should return `False` because it does not contain a substring that fits the pattern.

12 changes: 12 additions & 0 deletions string_2/contains-code-like/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,17 @@
{
"input": ["cooe and cope and cole"],
"output": true
},
{
"input": ["coze is here"],
"output": true
},
{
"input": ["acope and coze and code"],
"output": true
},
{
"input": ["coxa coke coo"],
"output": true
}
]
4 changes: 3 additions & 1 deletion string_2/contains-code-like/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def contains_code_like(s):
def contains_code_like(s: str) -> bool:
# Your code here
pass
3 changes: 1 addition & 2 deletions string_2/count-pairs/description.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Make a function that takes in a string and two characters, and returns how many times the two characters appear next to each other in the string, either directly before or in front of each other. If the string does not contain one of the characters or if both characters are the same, return 0.
Write a function `count_pairs(string: str, a: str, b: str) -> int` that takes in a string and two characters, and returns how many times the two characters appear next to each other in the string, either directly before or in front of each other. If the string does not contain one of the characters or if both characters are the same, return 0.

Note that pairs should not be double counted. For instance, if we wanted to count how many times "p" appears next to "a" in the word painting, we would only count it once as "pa" and not twice as "pa" and "ap".

Expand Down
20 changes: 20 additions & 0 deletions string_2/count-pairs/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,25 @@
{
"input": ["xxxxxxx", "x", "z"],
"output": 0
},
{
"input": ["abcdef", "a", "f"],
"output": 0
},
{
"input": ["ababa", "a", "b"],
"output": 4
},
{
"input": ["baab", "a", "b"],
"output": 2
},
{
"input": ["aaaa", "a", "a"],
"output": 0
},
{
"input": ["xyabz", "a", "b"],
"output": 1
}
]
4 changes: 3 additions & 1 deletion string_2/count-pairs/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def count_pairs(string, a, b):
def count_pairs(string: str, a: str, b: str) -> int:
# Your code here
pass
2 changes: 1 addition & 1 deletion string_2/count-repeat/description.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Given 2 strings `a` and `b`, return the total amount of sequences where `b` is repeated in a row. Note: the string `a` can be of any length and `b` will always be one character.
Write a function `count_repeat(a: str, b: str)` given 2 strings `a` and `b`, return the total amount of sequences where `b` is repeated in a row. Note: the string `a` can be of any length and `b` will always be one character.

For example:
- `count_repetition("byzzx", "z") → 1`
Comment on lines +1 to 4

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The examples use count_repetition(...), but the function name in this problem is count_repeat(...). Update the examples to call the correct function name to avoid confusing learners.

Copilot uses AI. Check for mistakes.
Expand Down
64 changes: 40 additions & 24 deletions string_2/count-repeat/io.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
[
{
"input": ["xyzcvvzx", "b"],
"output": 0
},
{
"input": ["xyvxx", "x"],
{
"input": ["xyzcvvzx", "b"],
"output": 0
},
{
"input": ["xyvxx", "x"],
"output": 1
},
{
"input": ["xxxxvxxxxxxxvxvx", "x"],
"output": 2
},
{
"input": [" ", "x"],
"output": 0
},
{
"input": ["hello", "l"],
"output": 1
},
{
"input": ["RAHHahh", "h"],
"output": 1
Comment on lines +23 to 24

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON formatting is inconsistent in this test case ("input"/"output" are indented differently than the surrounding objects). Please normalize indentation to keep the fixtures easy to diff and maintain.

Suggested change
"input": ["RAHHahh", "h"],
"output": 1
"input": ["RAHHahh", "h"],
"output": 1

Copilot uses AI. Check for mistakes.
},
{
"input": ["xxxxvxxxxxxxvxvx", "x"],
"output": 2
},
{
"input": [" ", "x"],
"output": 0
},
{
"input": ["hello", "l"],
"output": 1
},
{
"input": ["RAHHahh", "h"],
"output": 1
}
]
},
{
"input": ["aaaaaaa", "a"],
"output": 1
},
{
"input": ["AAaAAaaA", "a"],
"output": 1
},
{
"input": ["xxxyxxxxzxx", "x"],
"output": 3
},
{
"input": ["bbbabbbbabbb", "b"],
"output": 3
}
]
2 changes: 1 addition & 1 deletion string_2/count-repeat/meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Count Repeat",
"name": "countRepeat",
"name": "count_repeat",
"difficulty": "medium",
"author": "Jutulli",
"category": "String-2",
Expand Down
5 changes: 3 additions & 2 deletions string_2/count-repeat/starter.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
def countRepeat(a: str, b: str) -> bool:

def count_repeat(a: str, b: str):
# Your code here

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation inside the function body is inconsistent here (# Your code here is not 4-space indented). Align the comment and pass with 4 spaces to match the starter template convention used elsewhere in the repo.

Suggested change
# Your code here
# Your code here

Copilot uses AI. Check for mistakes.
pass
2 changes: 1 addition & 1 deletion string_2/count-vowels/description.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Write a function `count_vowels(s)` that takes a string and returns the number of vowels (a, e, i, o, u, y) in it.
Write a function `count_vowels(s: str) -> int` that takes a string and returns the number of vowels (a, e, i, o, u, y) in it.


For example:
Expand Down
24 changes: 24 additions & 0 deletions string_2/count-vowels/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,29 @@
{
"input": ["Don't bother with capital letters"],
"output": 9
},
{
"input": ["hmm"],
"output": 0
},
{
"input": ["beautiful sky"],
"output": 6
},
{
"input": ["AEiouYaeIOuy"],
"output": 12
},
{
"input": ["C0d1ng 1s Aw3s0m3!!! yeS"],
"output": 3
},
{
"input": ["queueing queues quietly"],
"output": 13
},
{
"input": ["syzygy rhythm crypt"],
"output": 5
}
]
5 changes: 3 additions & 2 deletions string_2/count-vowels/starter.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
def count_vowels(string):

def count_vowels(s: str) -> int:
# Your code here

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation inside the function body is inconsistent here (# Your code here uses a different indent level than pass). Use the standard 4-space indentation for both lines to match other starter templates.

Suggested change
# Your code here
# Your code here

Copilot uses AI. Check for mistakes.
pass
9 changes: 4 additions & 5 deletions string_2/double-every-nth-char/description.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Given a string and a positive integer n, return a modified string where every character at position n and its multiples is doubled. Count positions starting from 1.
Write a function `double_nth_char(text: str, n: int) -> str` given a string and a positive integer n, return a modified string where every character at position n and its multiples is doubled. Count positions starting from 1.

For example:
double_nth(“hello", 2) → 'heelllo' (doubles chars at positions 2,4)
double_nth('python', 3) → 'pytthonn' (doubles char at position 3,6)
double_nth('code', 1) → 'ccooddee' (doubles every char)

- double_nth('hello', 2) → 'heelllo' (doubles chars at positions 2,4)
- double_nth('python', 3) → 'pytthonn' (doubles char at position 3,6)
- double_nth('code', 1) → 'ccooddee' (doubles every char)
Comment thread
Vysan13 marked this conversation as resolved.
Resolved
8 changes: 8 additions & 0 deletions string_2/double-every-nth-char/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
{
"input": ["java", 3],
"output": "javva"
},
{
"input": ["xyz", 1],
"output": "xxyyzz"
},
{
"input": ["abcdef", 5],
"output": "abcdeef"
}

]
Expand Down
2 changes: 2 additions & 0 deletions string_2/double-every-nth-char/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def double_nth_char(text: str, n: int) -> str:
# Your code here

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Your code here should be indented inside the function body (4 spaces) to match the starter template convention used elsewhere in the repo; keep pass aligned with it.

Suggested change
# Your code here
# Your code here

Copilot uses AI. Check for mistakes.
pass
2 changes: 1 addition & 1 deletion string_2/double-letter/description.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Oh no! The letter pixie took consonants from these words!
Given a string, double the second consonant in the string to form the actual word.
Write a function `double_letter(word: str) -> str` given a string, double the second consonant in the string to form the actual word.


For example:
Expand Down
20 changes: 20 additions & 0 deletions string_2/double-letter/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,25 @@
{
"input": ["bo"],
"output": "bo"
},
{
"input": ["aio"],
"output": "aio"
},
{
"input": ["aeiobcd"],
"output": "aeiobccd"
},
{
"input": ["a e dog"],
"output": "a e dogg"
},
{
"input": ["BaNaNa"],
"output": "BaNNaNa"
},
{
"input": ["hi there!"],
"output": "hi tthere!"
}
]
4 changes: 3 additions & 1 deletion string_2/double-letter/starter.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
def double_letter(word):
def double_letter(word: str) -> str:
# Your code here

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Your code here should be indented inside the function body (4 spaces) to match the starter template convention used elsewhere in the repo; keep pass aligned with it.

Suggested change
# Your code here
# Your code here

Copilot uses AI. Check for mistakes.
pass
2 changes: 1 addition & 1 deletion string_2/every-other-repeated/description.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Write a function `every_other_repeated(a, b)` that counts how many substrings of length two, formed by taking every other letter from string `a` match the last two letters of string `b`.
Write a function `every_other_repeated(a: str, b: str) -> int` that counts how many substrings of length two, formed by taking every other letter from string `a` match the last two letters of string `b`.

For example:
- `every_other_repeated("ooooo", "ooooo")` → `3`
Expand Down
Loading
Loading