Code RoomUpper-case every name
EasyPrep Room Coding #5040

Upper-case every name

CodingAlgorithms & data structuresEntry–Mid~7 min

Given `contacts` with columns `email` and `name`, upper-case the `name` column. Return `email` and `name`, sorted by `email` ascending and then `name` ascending.

Implement
shout_names(contacts: dataframe) → dataframe
Examples
in[{"__df__":[{"name":"Ann","email":"a@x.com"},{"name":"Bob","email":"b@x.com"},{"name":"Ann","email":"a@x.com"},{"name":"Cy","email":"c@x.com"},{"name":"Bobby","email":"b@x.com"}]}]out[{"name":"ANN","email":"a@x.com"},{"name":"ANN","email":"a@x.com"},{"name":"BOB","email":"b@x.com"},{"name":"BOBBY","email":"b@x.com"},{"name":"CY","email":"c@x.com"}]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 7 min
InputExpectedGot
[{"__df__":[{"name":"Ann","email":"a@x.com"},{"name":"Bob","email":"b@x.com"},{"name":"Ann","email":"a@x.com"},{"name":"Cy","email":"c@x.com"},{"name":"Bobby","email":"b@x.com"}]}][{"name":"ANN","email":"a@x.com"},{"name":"ANN","email":"a@x.com"},{"name":"BOB","email":"b@x.com"},{"name":"BOBBY","email":"b@x.com"},{"name":"CY","email":"c@x.com"}]not run yetsample