Convert a given string into snake_case with a precise algorithm.
Constraints
Example
>>> to_snake_case("hello world")
'hello_world'
>>> to_snake_case("camelCase")
'camel_case'
>>> to_snake_case("foo-bar_baz")
'foo_bar_baz'
>>> to_snake_case("Hello World")
'hello_world'
>>> to_snake_case("getHTTPResponse")
'get_http_response'
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints