Problems > camelCase to snake_case

camelCase to snake_case

Difficulty: 900 2000 ms 128 MB

strings

Convert camelCase to snake_case: each uppercase letter becomes an underscore plus its lowercase form.

Input: one line with a camelCase identifier starting lowercase.

Output: the snake_case identifier.

Constraints:

  • 1 ≤ length ≤ 100

Sample Tests

Input 1
helloWorldNow
Output 1
hello_world_now
Input 2
solo
Output 2
solo

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.