Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Chat Room Names #64

Open
margo-yunanova opened this issue Sep 23, 2023 · 0 comments
Open

Generate Chat Room Names #64

margo-yunanova opened this issue Sep 23, 2023 · 0 comments
Assignees
Milestone

Comments

@margo-yunanova
Copy link
Owner

margo-yunanova commented Sep 23, 2023

You are writing a chat room app for your company.

Users have provided feedback that seeing everyone's full names on the screen creates too much noise, and have asked for it to be reduced. However, we still want to be able to uniquely identify everyone. The team have come up with a few rules that will hopefully help in solving this problem!

Note: It can be assumed that names are in the format of a first name and a last name consisting solely of letters from the English alphabet, both uppercase (A-Z) and lowercase (a-z), separated by a single space and if no names are provided, we should return an empty array.

  • If only one person in the chat room has a specific first name, only their first name will be written out.

John Smith -> John

  • If two or more people have a specific first name, but don't share a second name initial, their first name and second name initial will be written out.
John Smith -> John S    
John Adams -> John A
  • Finally, if two or more people have a specific first name and last name initial, their full name will be written out.
John Smith -> John Smith    
John Simms -> John Simms

To help tidy up the output, management have also asked that the chat room list should be alphabetised, by the users screen names and should all be in Title Case.

JOHN smith -> John Smith
For our purposes, when we receive the names casing is not important, meaning JOHn SmiTh is equal to john smith, after we've tidied up the casings, these should be interpreted as the same name.

Our company also has an unusual policy - we don't hire somebody if an employee already exists with the same full name, as our HR platform identifies staff by a combination of their first and last names. Due to this, we don't have to worry about multiple instances of the same full name.

@margo-yunanova margo-yunanova self-assigned this Sep 23, 2023
@margo-yunanova margo-yunanova added this to the Codewars milestone Sep 23, 2023
@margo-yunanova margo-yunanova changed the title Issue Title Generate Chat Room Names Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant