diff --git a/string_1/concat-double-char/io.json b/string_1/concat-double-char/io.json index 5461ba2e..d1ebd9ed 100644 --- a/string_1/concat-double-char/io.json +++ b/string_1/concat-double-char/io.json @@ -3,5 +3,13 @@ {"input": ["dog", "go"], "output": "dogo"}, {"input": ["aa", "a"], "output": "aa"}, {"input": ["", "start"],"output": "start"}, - {"input": ["end", ""], "output": "end"} + {"input": ["end", ""], "output": "end"}, + {"input": ["hello", "orange"], "output": "hellorange"}, + {"input": ["test", "test"], "output": "testest"}, + {"input": ["abc", "def"], "output": "abcdef"}, + {"input": ["a", "a"], "output": "a"}, + {"input": ["a", "b"], "output": "ab"}, + {"input": ["a", "A"], "output": "aA"}, + {"input": ["end.", ".start"], "output": "end.start"}, + {"input": ["hello ", " orange"], "output": "hello orange"} ] diff --git a/string_1/concat-double-char/starter.py b/string_1/concat-double-char/starter.py index 80765ef0..458e71e2 100644 --- a/string_1/concat-double-char/starter.py +++ b/string_1/concat-double-char/starter.py @@ -1 +1,3 @@ -def concat_no_double(a: str, b: str) -> str: \ No newline at end of file +def concat_no_double(a: str, b: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/double-n-th/description.md b/string_1/double-n-th/description.md new file mode 100644 index 00000000..769e0b5e --- /dev/null +++ b/string_1/double-n-th/description.md @@ -0,0 +1,15 @@ +Write a function `double_nth(str: str, n: int) -> str` that takes 2 inputs: a string `str` and an integer `n` . The function looks at the string and counts letters starting from 1 (not 0), restarting from 1 everytime `n` is reached. It should return a new string where every `n`-th character is repeated based on the following conditions: + +- If everything is normal, return a string with every `n`-th character repeated. +- If `n` is greater than the string length, return the original string. +- If `n` is less than or equal to 0, return `""`. +- if `str` is empty, return `""`. + + +For example: +- `double_nth("programming", 2)` → `"prroggraammminng"` +- `double_nth("hi", 3)` → `"hi"` +- `double_nth("bonjour", -2)` → `""` +- `double_nth("null", 0)` → `""` +- `double_nth("", -2)` → `""` + diff --git a/string_1/double_n-th/io.json b/string_1/double-n-th/io.json similarity index 50% rename from string_1/double_n-th/io.json rename to string_1/double-n-th/io.json index 8ed3f745..a3d1ce58 100644 --- a/string_1/double_n-th/io.json +++ b/string_1/double-n-th/io.json @@ -22,5 +22,33 @@ { "input": ["", -1], "output": "" + }, + { + "input": ["programming", 2], + "output": "prroggraammminng" + }, + { + "input": ["hi", 3], + "output": "hi" + }, + { + "input": ["bonjour", -2], + "output": "" + }, + { + "input": ["null", 0], + "output": "" + }, + { + "input": ["", -2], + "output": "" + }, + { + "input": ["abcdefg", 3], + "output": "abccdeffg" + }, + { + "input": ["aaaaaa", 1], + "output": "aaaaaaaaaaaa" } ] diff --git a/string_1/double_n-th/meta.json b/string_1/double-n-th/meta.json similarity index 100% rename from string_1/double_n-th/meta.json rename to string_1/double-n-th/meta.json diff --git a/string_1/double-n-th/starter.py b/string_1/double-n-th/starter.py new file mode 100644 index 00000000..74ac4537 --- /dev/null +++ b/string_1/double-n-th/starter.py @@ -0,0 +1,3 @@ +def double_nth(str: str, n: int) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/double_n-th/description.md b/string_1/double_n-th/description.md deleted file mode 100644 index c83c20e4..00000000 --- a/string_1/double_n-th/description.md +++ /dev/null @@ -1,15 +0,0 @@ -Write a function `double_n-th(str,n)` that when given a string and integer `n`, the count for `n` starting at 1 with the first letter instead of 0, that returns a new string where every `n`-th character position in the original string is repeated based on the following conditions: - -- Normally, you return the string with every `n`-th character repeated. -- If `n` is greater than the string length, return the original string. -- If `n` is less than or equal to 0, return `""`. -- if `str` is empty, return `""`. - - -For example: -- `double_n-th("programming", 2)` → `"prroggraammminng"` -- `double_n-th("hi", 3)` → `"hi"` -- `double_n-th("bonjour", -2)` → `""` -- `double_n-th("null", 0)` → `""` -- `double_n-th("", -2)` → `""` - diff --git a/string_1/double_n-th/starter.py b/string_1/double_n-th/starter.py deleted file mode 100644 index ecf0e652..00000000 --- a/string_1/double_n-th/starter.py +++ /dev/null @@ -1 +0,0 @@ -def double_nth(str,n): diff --git a/string_1/even-length/io.json b/string_1/even-length/io.json index 2f5d80de..bb2cb2f8 100644 --- a/string_1/even-length/io.json +++ b/string_1/even-length/io.json @@ -3,5 +3,13 @@ {"input": ["abc"], "output": false}, {"input": [""], "output": true}, {"input": ["😊😊"], "output": true}, - {"input": ["x"], "output": false} + {"input": ["x"], "output": false}, + {"input": ["hello!"], "output": true}, + {"input": ["hello"], "output": false}, + {"input": ["12345678"], "output": true}, + {"input": ["1234567"], "output": false}, + {"input": [" "], "output": false}, + {"input": [" "], "output": true}, + {"input": ["😊"], "output": false}, + {"input": ["😊😊😊"],"output": false} ] diff --git a/string_1/even-length/starter.py b/string_1/even-length/starter.py index 91fce89c..a2a0d154 100644 --- a/string_1/even-length/starter.py +++ b/string_1/even-length/starter.py @@ -1 +1,3 @@ -def is_even_length(s: str) -> bool: \ No newline at end of file +def is_even_length(s: str) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/string_1/first-chars-or-at/io.json b/string_1/first-chars-or-at/io.json index ffd68139..af4516e3 100644 --- a/string_1/first-chars-or-at/io.json +++ b/string_1/first-chars-or-at/io.json @@ -3,5 +3,13 @@ {"input": ["A"], "output": "A@"}, {"input": [""], "output": "@@"}, {"input": ["ab"], "output": "ab"}, - {"input": ["😊"], "output": "😊@"} + {"input": ["😊"], "output": "😊@"}, + {"input": ["Hi"], "output": "Hi"}, + {"input": ["H"], "output": "H@"}, + {"input": [" "], "output": " @"}, + {"input": [" "], "output": " "}, + {"input": ["X"], "output": "X@"}, + {"input": ["XY"], "output": "XY"}, + {"input": ["Good"], "output": "Go"}, + {"input": ["G "], "output": "G "} ] diff --git a/string_1/first-chars-or-at/starter.py b/string_1/first-chars-or-at/starter.py index 24f6c1f1..80475d3f 100644 --- a/string_1/first-chars-or-at/starter.py +++ b/string_1/first-chars-or-at/starter.py @@ -1 +1,3 @@ -def first_two(s: str) -> str: \ No newline at end of file +def first_two(s: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/first-last-n-chars/io.json b/string_1/first-last-n-chars/io.json index a8ac418d..e2ab9385 100644 --- a/string_1/first-last-n-chars/io.json +++ b/string_1/first-last-n-chars/io.json @@ -3,5 +3,13 @@ {"input": ["Python", 1], "output": "Pn"}, {"input": ["edge", 2], "output": "edge"}, {"input": ["abc", 0], "output": ""}, - {"input": ["aabbcc", 3], "output": "aabbcc"} + {"input": ["aabbcc", 3], "output": "aabbcc"}, + {"input": ["abcdef", 2], "output": "abef"}, + {"input": ["hello", 4], "output": "hellello"}, + {"input": ["world", 5], "output": "worldworld"}, + {"input": ["test", 1], "output": "tt"}, + {"input": ["example", 3], "output": "exaple"}, + {"input": ["data", 2], "output": "data"}, + {"input": ["x", 1], "output": "xx"}, + {"input": ["openai", 0], "output": ""} ] diff --git a/string_1/first-last-n-chars/starter.py b/string_1/first-last-n-chars/starter.py index 74138661..49fbcd9a 100644 --- a/string_1/first-last-n-chars/starter.py +++ b/string_1/first-last-n-chars/starter.py @@ -1 +1,3 @@ -def front_back_n(s: str, n: int) -> str: \ No newline at end of file +def front_back_n(s: str, n: int) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/first-two/description.md b/string_1/first-two/description.md deleted file mode 100644 index 0aa0bcc0..00000000 --- a/string_1/first-two/description.md +++ /dev/null @@ -1,5 +0,0 @@ -Write a function `first_two(s: str) -> str` that returns the first two characters of a string. If the string is shorter than two characters, return it as-is. -Examples: -- `"Hello"` → `"He"` -- `"X"` → `"X"` -- `""` → `""` \ No newline at end of file diff --git a/string_1/first-two/io.json b/string_1/first-two/io.json deleted file mode 100644 index 80214295..00000000 --- a/string_1/first-two/io.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - {"input": ["Hello"], "output": "He"}, - {"input": ["X"], "output": "X"}, - {"input": [""], "output": ""}, - {"input": ["A"], "output": "A"}, - {"input": ["AB"], "output": "AB"} -] \ No newline at end of file diff --git a/string_1/first-two/meta.json b/string_1/first-two/meta.json deleted file mode 100644 index ddc7bafc..00000000 --- a/string_1/first-two/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "First Two", - "name": "first_two", - "difficulty": "easy", - "author": "ChatGPT, edited by Eric", - "category": "String-1", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/string_1/first-two/starter.py b/string_1/first-two/starter.py deleted file mode 100644 index 24f6c1f1..00000000 --- a/string_1/first-two/starter.py +++ /dev/null @@ -1 +0,0 @@ -def first_two(s: str) -> str: \ No newline at end of file diff --git a/string_1/front-again/io.json b/string_1/front-again/io.json index 6e5caaa9..523044c3 100644 --- a/string_1/front-again/io.json +++ b/string_1/front-again/io.json @@ -1,7 +1,15 @@ [ {"input": ["edited"], "output": true}, {"input": ["edit"], "output": false}, - {"input": ["level"], "output": true}, + {"input": ["level"], "output": false}, {"input": ["aa"], "output": true}, - {"input": ["abcab"], "output": false} + {"input": ["abcab"], "output": true}, + {"input": ["noon"], "output": false}, + {"input": ["hello"], "output": false}, + {"input": ["hellohe"], "output": true}, + {"input": ["abxxab"], "output": true}, + {"input": ["abab"], "output": true}, + {"input": ["eoe"], "output": false}, + {"input": ["testtest"], "output": false}, + {"input": [""], "output": true} ] diff --git a/string_1/front-again/starter.py b/string_1/front-again/starter.py index 69019871..2116574d 100644 --- a/string_1/front-again/starter.py +++ b/string_1/front-again/starter.py @@ -1 +1,3 @@ -def front_again(s: str) -> bool: \ No newline at end of file +def front_again(s: str) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/string_1/fuzzy-first-char/description.md b/string_1/fuzzy-first-char/description.md index 823bdbb4..057f963b 100644 --- a/string_1/fuzzy-first-char/description.md +++ b/string_1/fuzzy-first-char/description.md @@ -1,6 +1,9 @@ -Write a function `start_word(s: str, word: str) -> str` that returns the beginning of `s` if `word` **matches** `s` at the front **except** the first character need not match. -If it matches, return that front portion of `s`; otherwise return an empty string. -The parameter `word` is at least length 1. +Write a function `start_word(s: str, word: str) -> str` that does the following: + +* Check if the substring of `s` starting from the second character matches the substring from `word` starting from its second character. +* If it matches, return the first part of `s` that has the same length as word. +* If it doesn't match, return an empty string `""` + Examples: * `("hippo", "hi")` → `"hi"` * `("hippo", "xip")` → `"hip"` \ No newline at end of file diff --git a/string_1/fuzzy-first-char/io.json b/string_1/fuzzy-first-char/io.json index 27be7db6..6aff4c32 100644 --- a/string_1/fuzzy-first-char/io.json +++ b/string_1/fuzzy-first-char/io.json @@ -1,7 +1,15 @@ [ {"input": ["hippo", "hi"], "output": "hi"}, {"input": ["hippo", "xip"], "output": "hip"}, - {"input": ["hippo", "zip"], "output": ""}, + {"input": ["hippo", "zip"], "output": "hip"}, {"input": ["h", "a"], "output": "h"}, - {"input": ["abc", "abc"], "output": "abc"} + {"input": ["abc", "abc"], "output": "abc"}, + {"input": ["abc", "xbc"], "output": "abc"}, + {"input": ["abc", "axc"], "output": ""}, + {"input": ["a", "a"], "output": "a"}, + {"input": ["a", "b"], "output": "a"}, + {"input": ["a", "ab"], "output": ""}, + {"input": ["hello", "he"], "output": "he"}, + {"input": ["hello", "xe"], "output": "he"}, + {"input": ["hello", "helloo"], "output": ""} ] diff --git a/string_1/fuzzy-first-char/starter.py b/string_1/fuzzy-first-char/starter.py index 75d6d2c6..02360e59 100644 --- a/string_1/fuzzy-first-char/starter.py +++ b/string_1/fuzzy-first-char/starter.py @@ -1 +1,3 @@ -def start_word(s: str, word: str) -> str: \ No newline at end of file +def start_word(s: str, word: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/greeting/io.json b/string_1/greeting/io.json index fe759b17..6a9ca02f 100644 --- a/string_1/greeting/io.json +++ b/string_1/greeting/io.json @@ -2,5 +2,14 @@ {"input": ["Bob"], "output": "Hello Bob!"}, {"input": ["Alice"], "output": "Hello Alice!"}, {"input": ["Eric"], "output": "Hello Eric!"}, - {"input": [""], "output": "Hello !"} + {"input": ["John Doe"], "output": "Hello John Doe!"}, + {"input": ["Jane Smith"], "output": "Hello Jane Smith!"}, + {"input": ["O'Neil"], "output": "Hello O'Neil!"}, + {"input": ["Li"], "output": "Hello Li!"}, + {"input": ["Anne-Marie"], "output": "Hello Anne-Marie!"}, + {"input": ["😊"], "output": "Hello 😊!"}, + {"input": ["123"], "output": "Hello 123!"}, + {"input": ["Dr. Robert"], "output": "Hello Dr. Robert!"}, + {"input": [" "], "output": "Hello !"}, + {"input": ["Jean-Luc"], "output": "Hello Jean-Luc!"} ] \ No newline at end of file diff --git a/string_1/greeting/starter.py b/string_1/greeting/starter.py index 46a5b81c..c7ead610 100644 --- a/string_1/greeting/starter.py +++ b/string_1/greeting/starter.py @@ -1 +1,3 @@ -def hello_greeting(name: str) -> str: \ No newline at end of file +def hello_greeting(name: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/half-digit/io.json b/string_1/half-digit/io.json index 2f17bd80..488dfd07 100644 --- a/string_1/half-digit/io.json +++ b/string_1/half-digit/io.json @@ -1,8 +1,15 @@ - [ {"input": ["123abc"], "output": true}, {"input": ["12a3bc"], "output": false}, {"input": ["00xx"], "output": true}, {"input": ["9Z"], "output": true}, - {"input": ["ab12"], "output": false} + {"input": ["ab12"], "output": false}, + {"input": ["4567abcd"], "output": true}, + {"input": ["1234abcd"], "output": true}, + {"input": ["123x5678"], "output": false}, + {"input": ["0000zzzz"], "output": true}, + {"input": ["98765432"], "output": true}, + {"input": [" "], "output": false}, + {"input": ["12ab34cd"], "output": false}, + {"input": ["11112222"], "output": true} ] diff --git a/string_1/half-digit/starter.py b/string_1/half-digit/starter.py index 06c4646a..d504f26b 100644 --- a/string_1/half-digit/starter.py +++ b/string_1/half-digit/starter.py @@ -1 +1,3 @@ -def is_half_digit(s: str) -> bool: \ No newline at end of file +def is_half_digit(s: str) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/string_1/halve-string/description.md b/string_1/halve-string/description.md deleted file mode 100644 index 15a7443b..00000000 --- a/string_1/halve-string/description.md +++ /dev/null @@ -1,3 +0,0 @@ -Write a function `half_string(s: str) -> str` that returns the first half of the input string `s`. -You may assume the length of `s` is even. -Example: `"Python"` → `"Pyt"`. \ No newline at end of file diff --git a/string_1/halve-string/io.json b/string_1/halve-string/io.json deleted file mode 100644 index a7cdce6c..00000000 --- a/string_1/halve-string/io.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - {"input": ["Python"], "output": "Pyt"}, - {"input": ["code"], "output": "co"}, - {"input": ["ab"], "output": "a"}, - {"input": ["abcdabcd"], "output": "abcd"}, - {"input": ["xyxy"], "output": "xy"} -] \ No newline at end of file diff --git a/string_1/halve-string/meta.json b/string_1/halve-string/meta.json deleted file mode 100644 index 93e8e9e8..00000000 --- a/string_1/halve-string/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ -"title": "Half of the String", -"name": "half_string", -"difficulty": "easy", -"author": "ChatGPT, edited by Eric", -"category": "String-1", -"question_type": [ - "coding" -] -} \ No newline at end of file diff --git a/string_1/halve-string/starter.py b/string_1/halve-string/starter.py deleted file mode 100644 index cdee593e..00000000 --- a/string_1/halve-string/starter.py +++ /dev/null @@ -1 +0,0 @@ -def half_string(s: str) -> str: \ No newline at end of file diff --git a/string_1/html-tagged/io.json b/string_1/html-tagged/io.json index 3a131f72..adb2e94f 100644 --- a/string_1/html-tagged/io.json +++ b/string_1/html-tagged/io.json @@ -3,5 +3,13 @@ {"input": [""], "output": "<>"}, {"input": ["123"], "output": "<123>"}, {"input": [""], "output": "<>"}, - {"input": ["&"], "output": "<&>"} + {"input": ["&"], "output": "<&>"}, + {"input": ["hello world"], "output": ""}, + {"input": ["!"], "output": ""}, + {"input": ["a"], "output": ""}, + {"input": ["<>"], "output": "<<>>"}, + {"input": ["{}"], "output": "<{}>"}, + {"input": ["<>123"], "output": "<<>123>"}, + {"input": ["😀"], "output": "<😀>"}, + {"input": [""], "output": "<>"} ] diff --git a/string_1/html-tagged/starter.py b/string_1/html-tagged/starter.py index 169bcfda..b59e074c 100644 --- a/string_1/html-tagged/starter.py +++ b/string_1/html-tagged/starter.py @@ -1 +1,3 @@ -def html_bracket(s: str) -> str: \ No newline at end of file +def html_bracket(s: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/ly-ending/io.json b/string_1/ly-ending/io.json index c41608e1..52b30fa2 100644 --- a/string_1/ly-ending/io.json +++ b/string_1/ly-ending/io.json @@ -3,5 +3,18 @@ {"input": ["sad"], "output": false}, {"input": ["fly"], "output": true}, {"input": ["LY"], "output": false}, - {"input": ["ly"], "output": true} + {"input": ["ly"], "output": true}, + {"input": ["apply"], "output": true}, + {"input": ["flyer"], "output": false}, + {"input": ["lyric"], "output": false}, + {"input": ["daily"], "output": true}, + {"input": ["ally"], "output": true}, + {"input": ["delay"], "output": false}, + {"input": ["lying"], "output": false}, + {"input": ["family"], "output": true}, + {"input": ["only"], "output": true}, + {"input": ["slyly"], "output": true}, + {"input": [" "], "output": false}, + {"input": ["bully"], "output": true}, + {"input": ["flyby"], "output": false} ] diff --git a/string_1/ly-ending/starter.py b/string_1/ly-ending/starter.py index 6177be87..8b30d94e 100644 --- a/string_1/ly-ending/starter.py +++ b/string_1/ly-ending/starter.py @@ -1 +1,3 @@ -def ends_with_ly(word: str) -> bool: \ No newline at end of file +def ends_with_ly(word: str) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/string_1/make-abba/io.json b/string_1/make-abba/io.json index de882ee5..3556c8e6 100644 --- a/string_1/make-abba/io.json +++ b/string_1/make-abba/io.json @@ -3,5 +3,13 @@ {"input": ["Yo", "Alice"], "output": "YoAliceAliceYo"}, {"input": ["What", "Up"], "output": "WhatUpUpWhat"}, {"input": ["", "X"], "output": "XX"}, - {"input": ["X", ""], "output": "XX"} + {"input": ["X", ""], "output": "XX"}, + {"input": ["a", "b"], "output": "abba"}, + {"input": ["hello", "world"], "output": "helloworldworldhello"}, + {"input": ["123", "456"], "output": "123456456123"}, + {"input": ["repeat", "repeat"], "output": "repeatrepeatrepeatrepeat"}, + {"input": ["first", "second"], "output": "firstsecondsecondfirst"}, + {"input": ["abc", "def"], "output": "abcdefdefabc"}, + {"input": ["x", "y"], "output": "xyyx"}, + {"input": ["dog", " "], "output": "dog dog"} ] \ No newline at end of file diff --git a/string_1/make-abba/starter.py b/string_1/make-abba/starter.py index 9c70646d..a6beb1cd 100644 --- a/string_1/make-abba/starter.py +++ b/string_1/make-abba/starter.py @@ -1 +1,3 @@ -def make_abba(a: str, b: str) -> str: \ No newline at end of file +def make_abba(a: str, b: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/make-tags/io.json b/string_1/make-tags/io.json index 1824e2cc..b5a89099 100644 --- a/string_1/make-tags/io.json +++ b/string_1/make-tags/io.json @@ -1,5 +1,15 @@ [ {"input": ["i", "Yay"], "output": "Yay"}, {"input": ["b", "Hello"], "output": "Hello"}, - {"input": ["cite", "Text"], "output": "Text"} + {"input": ["cite", "Text"], "output": "Text"}, + {"input": ["p", "Paragraph"], "output": "

Paragraph

"}, + {"input": ["div", "content"], "output": "
content
"}, + {"input": ["h1", "Title"], "output": "

Title

"}, + {"input": ["em", "Emphasizez"], "output": "Emphasizez"}, + {"input": ["strong", "Important"], "output": "Important"}, + {"input": ["span", "Inline"], "output": "Inline"}, + {"input": ["a", "Link"], "output": "
Link"}, + {"input": ["ul", "List"], "output": "
    List
"}, + {"input": ["li", "Item"], "output": "
  • Item
  • "}, + {"input": ["h2", "Subtitle"], "output": "

    Subtitle

    "} ] \ No newline at end of file diff --git a/string_1/make-tags/starter.py b/string_1/make-tags/starter.py index edbb137d..58fe0ea2 100644 --- a/string_1/make-tags/starter.py +++ b/string_1/make-tags/starter.py @@ -1 +1,3 @@ -def make_tags(tag: str, word: str) -> str: \ No newline at end of file +def make_tags(tag: str, word: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/middle-chars/io.json b/string_1/middle-chars/io.json index beefd8e7..6c6fc212 100644 --- a/string_1/middle-chars/io.json +++ b/string_1/middle-chars/io.json @@ -3,5 +3,13 @@ {"input": ["abba"], "output": "bb"}, {"input": ["code"], "output": "od"}, {"input": ["tyty"], "output": "yt"}, - {"input": ["aa"], "output": "aa"} + {"input": ["aa"], "output": "aa"}, + {"input": ["middle"], "output": "dd"}, + {"input": ["testing"], "output": "st"}, + {"input": ["python"], "output": "th"}, + {"input": ["zzzz"], "output": "zz"}, + {"input": ["abcd"], "output": "bc"}, + {"input": ["xy"], "output": "xy"}, + {"input": ["hello!"], "output": "ll"}, + {"input": ["aabbcc"], "output": "bb"} ] diff --git a/string_1/middle-chars/starter.py b/string_1/middle-chars/starter.py index 60c1e97d..c7f420ce 100644 --- a/string_1/middle-chars/starter.py +++ b/string_1/middle-chars/starter.py @@ -1 +1,3 @@ -def middle_two(s: str) -> str: \ No newline at end of file +def middle_two(s: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/remove-x-from-start/description.md b/string_1/remove-x-from-start/description.md deleted file mode 100644 index d5182221..00000000 --- a/string_1/remove-x-from-start/description.md +++ /dev/null @@ -1,6 +0,0 @@ -Write a function `remove_x_from_start(s: str) -> str` that removes `'x'` characters from the first two characters of a string. Keep the rest of the string as-is. If neither of the first two characters is `'x'`, return the string unchanged. -Examples: -- `"xHi"` → `"Hi"` -- `"Hxi"` → `"Hi"` -- `"Hi"` → `"Hi"` -- `"xxHi"` → `"Hi"` \ No newline at end of file diff --git a/string_1/remove-x-from-start/io.json b/string_1/remove-x-from-start/io.json deleted file mode 100644 index 29a3d4bf..00000000 --- a/string_1/remove-x-from-start/io.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - {"input": ["xHi"], "output": "Hi"}, - {"input": ["Hxi"], "output": "Hi"}, - {"input": ["Hi"], "output": "Hi"}, - {"input": ["xxHi"], "output": "Hi"}, - {"input": ["x"], "output": ""}, - {"input": [""], "output": ""} -] \ No newline at end of file diff --git a/string_1/remove-x-from-start/meta.json b/string_1/remove-x-from-start/meta.json deleted file mode 100644 index e7e8ff9a..00000000 --- a/string_1/remove-x-from-start/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Remove X From Start", - "name": "remove_x_from_start", - "difficulty": "hard", - "author": "ChatGPT, edited by Eric", - "category": "String-1", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/string_1/remove-x-from-start/starter.py b/string_1/remove-x-from-start/starter.py deleted file mode 100644 index d762314f..00000000 --- a/string_1/remove-x-from-start/starter.py +++ /dev/null @@ -1 +0,0 @@ -def remove_x_from_start(s: str) -> str: \ No newline at end of file diff --git a/string_1/remove-x/io.json b/string_1/remove-x/io.json index dd8d2c90..c4a57c55 100644 --- a/string_1/remove-x/io.json +++ b/string_1/remove-x/io.json @@ -4,5 +4,12 @@ {"input": ["Hix"], "output": "Hi"}, {"input": ["Hi"], "output": "Hi"}, {"input": ["x"], "output": ""}, - {"input": [""], "output": ""} + {"input": ["abcx"], "output": "abc"}, + {"input": ["xx"], "output": ""}, + {"input": ["abcd"], "output": "abcd"}, + {"input": ["xaxb"], "output": "axb"}, + {"input": ["bxx"], "output": "bx"}, + {"input": ["xabx"], "output": "ab"}, + {"input": ["hello"], "output": "hello"}, + {"input": ["hexllo"], "output": "hexllo"} ] \ No newline at end of file diff --git a/string_1/remove-x/starter.py b/string_1/remove-x/starter.py index e79d56b1..6496d265 100644 --- a/string_1/remove-x/starter.py +++ b/string_1/remove-x/starter.py @@ -1 +1,3 @@ -def remove_x_from_ends(s: str) -> str: \ No newline at end of file +def remove_x_from_ends(s: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/right-two/description.md b/string_1/right-two/description.md index 920d2835..47a10013 100644 --- a/string_1/right-two/description.md +++ b/string_1/right-two/description.md @@ -1,4 +1,4 @@ -Write a function `right2(s: str) -> str` that returns a "rotated right 2" version where the last 2 characters are moved to the beginning. +Write a function `right_2(s: str) -> str` that returns a "rotated right 2" version where the last 2 characters are moved to the beginning. Examples: - `"Hello"` → `"loHel"` - `"java"` → `"vaja"` diff --git a/string_1/right-two/io.json b/string_1/right-two/io.json index 3a3ef154..02c9c3b9 100644 --- a/string_1/right-two/io.json +++ b/string_1/right-two/io.json @@ -2,5 +2,14 @@ {"input": ["Hello"], "output": "loHel"}, {"input": ["java"], "output": "vaja"}, {"input": ["Hi"], "output": "Hi"}, - {"input": ["ab"], "output": "ab"} + {"input": ["ab"], "output": "ab"}, + {"input": ["abcdef"], "output": "efabcd"}, + {"input": ["rotation"], "output": "onrotati"}, + {"input": ["Python"], "output": "onPyth"}, + {"input": ["xy"], "output": "xy"}, + {"input": ["12345"], "output": "45123"}, + {"input": ["aabbcc"], "output": "ccaabb"}, + {"input": ["test"], "output": "stte"}, + {"input": ["code"], "output": "deco"}, + {"input": ["zz"], "output": "zz"} ] \ No newline at end of file diff --git a/string_1/right-two/meta.json b/string_1/right-two/meta.json index 9f962800..61c08fc1 100644 --- a/string_1/right-two/meta.json +++ b/string_1/right-two/meta.json @@ -1,6 +1,6 @@ { "title": "Right 2", - "name": "right2", + "name": "right_2", "difficulty": "medium", "author": "ChatGPT, edited by Eric", "category": "String-1", diff --git a/string_1/right-two/starter.py b/string_1/right-two/starter.py index 1d2ec888..bfca4a43 100644 --- a/string_1/right-two/starter.py +++ b/string_1/right-two/starter.py @@ -1 +1,3 @@ -def right2(s: str) -> str: \ No newline at end of file +def right_2(s: str) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/the_end/description.md b/string_1/the_end/description.md deleted file mode 100644 index 128f165d..00000000 --- a/string_1/the_end/description.md +++ /dev/null @@ -1,5 +0,0 @@ -Write a function `the_end(s: str, front: bool) -> str` that returns a string of length 1 from the start of the input if `front` is `True`, otherwise from the end. -Examples: -- `"Hello", True` → `"H"` -- `"Hello", False` → `"o"` -- `"oh", True` → `"o"` \ No newline at end of file diff --git a/string_1/the_end/io.json b/string_1/the_end/io.json deleted file mode 100644 index 84d6a103..00000000 --- a/string_1/the_end/io.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - {"input": ["Hello", true], "output": "H"}, - {"input": ["Hello", false], "output": "o"}, - {"input": ["oh", true], "output": "o"}, - {"input": ["oh", false], "output": "h"}, - {"input": ["a", true], "output": "a"}, - {"input": ["a", false], "output": "a"} -] diff --git a/string_1/the_end/meta.json b/string_1/the_end/meta.json deleted file mode 100644 index 1d4e7ed1..00000000 --- a/string_1/the_end/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "The End", - "name": "the_end", - "difficulty": "medium", - "author": "ChatGPT, edited by Eric", - "category": "String-1", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/string_1/the_end/starter.py b/string_1/the_end/starter.py deleted file mode 100644 index f1d3c68d..00000000 --- a/string_1/the_end/starter.py +++ /dev/null @@ -1 +0,0 @@ -def the_end(s: str, front: bool) -> str: \ No newline at end of file diff --git a/string_1/two-chars-at-index/io.json b/string_1/two-chars-at-index/io.json index ccd36296..36442bed 100644 --- a/string_1/two-chars-at-index/io.json +++ b/string_1/two-chars-at-index/io.json @@ -3,5 +3,13 @@ {"input": ["java", 2], "output": "va"}, {"input": ["java", 3], "output": "ja"}, {"input": ["Hi", 1], "output": "Hi"}, - {"input": ["code", -1], "output": "co"} + {"input": ["code", -1], "output": "co"}, + {"input": ["hello", 1], "output": "el"}, + {"input": ["hello", 3], "output": "lo"}, + {"input": ["hello", 4], "output": "he"}, + {"input": ["ab", 0], "output": "ab"}, + {"input": ["ab", 2], "output": "ab"}, + {"input": ["abcdef", 4], "output": "ef"}, + {"input": ["abcdef", 5], "output": "ab"}, + {"input": ["xyz", -2], "output": "xy"} ] diff --git a/string_1/two-chars-at-index/starter.py b/string_1/two-chars-at-index/starter.py index 6c4e9522..305b10b6 100644 --- a/string_1/two-chars-at-index/starter.py +++ b/string_1/two-chars-at-index/starter.py @@ -1 +1,3 @@ -def two_char_at(s: str, index: int) -> str: \ No newline at end of file +def two_char_at(s: str, index: int) -> str: + # Your code here + pass \ No newline at end of file diff --git a/string_1/validate-phone-number/io.json b/string_1/validate-phone-number/io.json index 0a04c51a..433e72b2 100644 --- a/string_1/validate-phone-number/io.json +++ b/string_1/validate-phone-number/io.json @@ -3,5 +3,13 @@ {"input": ["514-555-1234"], "output": true}, {"input": ["514-5551234"], "output": false}, {"input": ["514555123"], "output": false}, - {"input": ["abc-def-ghij"], "output": false} + {"input": ["abc-def-ghij"], "output": false}, + {"input": ["514-555-12345"], "output": false}, + {"input": ["514-555-12345"], "output": false}, + {"input": ["514-555-12a4"], "output": false}, + {"input": ["514-555--1234"], "output": false}, + {"input": ["800-555-1212"], "output": true}, + {"input": ["8005551212"], "output": true}, + {"input": ["51455512345"], "output": false}, + {"input": ["514555-1234"], "output": false} ] diff --git a/string_1/validate-phone-number/starter.py b/string_1/validate-phone-number/starter.py index 44c3159f..bda9fcfd 100644 --- a/string_1/validate-phone-number/starter.py +++ b/string_1/validate-phone-number/starter.py @@ -1 +1,3 @@ -def is_phone_number(s: str) -> bool: \ No newline at end of file +def is_phone_number(s: str) -> bool: + # Your code here + pass \ No newline at end of file diff --git a/string_1/without-end/description.md b/string_1/without-end/description.md deleted file mode 100644 index 3a2f5ee8..00000000 --- a/string_1/without-end/description.md +++ /dev/null @@ -1,4 +0,0 @@ -Write a function `without_end(s: str) -> str` that removes the first and last characters of a string. The input string will have a length of at least 2. -Examples: -- `"Hello"` → `"ell"` -- `"Java"` → `"av"` \ No newline at end of file diff --git a/string_1/without-end/io.json b/string_1/without-end/io.json deleted file mode 100644 index 2b804ab7..00000000 --- a/string_1/without-end/io.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - {"input": ["Hello"], "output": "ell"}, - {"input": ["Java"], "output": "av"}, - {"input": ["ab"], "output": ""}, - {"input": ["abc"], "output": "b"} -] \ No newline at end of file diff --git a/string_1/without-end/meta.json b/string_1/without-end/meta.json deleted file mode 100644 index 6896fdc0..00000000 --- a/string_1/without-end/meta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Without End", - "name": "without_end", - "difficulty": "easy", - "author": "ChatGPT, edited by Eric", - "category": "String-1", - "question_type": [ - "coding" - ] -} \ No newline at end of file diff --git a/string_1/without-end/starter.py b/string_1/without-end/starter.py deleted file mode 100644 index d9064a4d..00000000 --- a/string_1/without-end/starter.py +++ /dev/null @@ -1 +0,0 @@ -def without_end(s: str) -> str: \ No newline at end of file