Random Link ¯\_(ツ)_/¯ | ||
Sep 2, 2017 | » | 000. Longest Two-Character Substring
2 min; updated Sep 2, 2017
Description Given a string, find the longest sub-string that contains, at most, two characters. /r/dailyprogrammer post Solution """ Finds the longest sub-string that contains, at most, two characters. Input: An all lower-case string, e.g. abbccc abcabcabcabccc qwertyytrewq Output: Print the longest sub-string of the given string that contains, at most, two unique characters. If you find multiple sub-strings that match the description, print the last sub-string (furthest to the right).... |
Nov 3, 2019 | » | 218. To-Do List Pt. I
1 min; updated Nov 3, 2019
Description Create a todo list with the following features: addItem, deleteItem and viewList. /r/dailyprogrammer post |
Sep 22, 2019 | » | 380. Smooshed Morse Code
6 min; updated Sep 22, 2019
Description Covert a string, e.g. programmer into Morse code, e.g. .--..-.-----..-..-----..-. /r/dailyprogrammer thread Solution """ _380_smooshed_morse_code.py Solve https://www.reddit.com/r/dailyprogrammer/comments/cmd1hb/20190805_challenge_380_easy_smooshed_morse_code_1/ """ from typing import List, Iterable from collections import defaultdict import os """A mapping of `[a...z]` to Morse code.""" ALPHA_TO_MORSE = { "a": ".-", "b": "-...", "c": "-.-.", "d": "-..", "e": ".", "f": "..-.", "g": "--.", "h": "....", "i": "..", "j": ".---", "k": "-.-", "l": ".-..", "m": "--", "n": "-.", "o": "---", "p": ".... |