Leaderboard
Prompts
Write a Python function that determines if a string is a valid cat name. Be opinionated about what makes a good cat name.
Write a JavaScript function called `meowMorse` that converts a string to morse code, but uses "meow" for dots and "MEOW" for dashes. Spaces between words should be represented by "๐บ". Include at least two test cases.
Write a Python class for a simple LRU (Least Recently Used) cache with a configurable max size. It should support `get(key)` and `put(key, value)`. Don't use `functools.lru_cache` or any other built-in LRU implementation. Include docstrings and at least 3 test cases that demonstrate eviction behavior.
Write a Bash script that watches a directory and prints a summary whenever a new file appears. The summary should include: filename, file size in human-readable form, file type (from the `file` command), and a SHA-256 hash. Handle the case where the directory doesn't exist yet.
Write a Python implementation of the Aho-Corasick string matching algorithm. It should accept a list of pattern strings, build the automaton, and provide a `search(text)` method that returns all matches with their positions and which pattern matched. Include type hints, docstrings, and test cases that cover overlapping patterns.








