You are given n identifiers written in snake_case (lowercase letters, digits, and underscores). For each one, convert it to lowerCamelCase: treat any run of one or more underscores as a single word separator, keep the first word exactly as-is, and for every subsequent word capitalize only its first character (the rest of that word keeps its original case) before concatenating all words with no separator. Leading or trailing underscores contribute no extra (empty) words. An identifier made up entirely of underscores converts to an empty string.
Line 1: an integer n.
Lines 2..n+1: one identifier per line, each consisting only of lowercase letters, digits, and underscores (a line may be empty).
n lines: the camelCase conversion of each identifier, in the same order as the input.
Example 1
Input
2 user_first_name id
Expected
userFirstName id
Explanation
`user_first_name` splits into words user/first/name -> `userFirstName`; `id` has no underscore so it is unchanged.
Example 2
Input
1 __a__b__
Expected
aB
Explanation
Leading/trailing/doubled underscores collapse; the two words `a` and `b` become `aB`.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →