Basic slug
Input
Hello, World! This is Python.
Output
hello-world-this-is-python
Lowercased, punctuation removed, first 5 words joined with hyphens.
Full lesson preview
Convert arbitrary text into a clean, SEO-friendly URL slug by normalizing, removing non-alphanumerics, and joining words with hyphens.
Problem statement
Task
Examples
Input
Hello, World! This is Python.
Output
hello-world-this-is-python
Lowercased, punctuation removed, first 5 words joined with hyphens.
Input format
Output format
Constraints
Samples
Input
This --- is crazy!!
Output
this-is-crazy
Multiple separators and punctuation are removed; whitespace collapsed and hyphens used to join words.