码迷,mamicode.com
首页 > 其他好文 > 详细

[虚拟机]Usernames System 用户名系统

时间:2019-09-12 18:36:50      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:ati   dde   function   bsp   requests   ESS   hat   nbsp   alice   

In this challenge, you will create the username portion of a registration system. All usernames must be unique. If a new user requests a name that is already used, an integer should be added to the end of the username to make it unique.

As an example, if username requests were for [bob, alice, bob, alice, bob, alice], your system should assign username bob, alice, bob1, alice1, bob2, alice2

Given a list of username requests in the order given, process all requests and return an array of the username as assigned by your function.

Function Description
Complete the function usernamesSystem in the editor below.

The function must return an array of username in the order desired.

 

usernamesSystem has the following parameter(s):
an array of username strings in the order required

 

 

题意:

思路:

代码:

 

[虚拟机]Usernames System 用户名系统

标签:ati   dde   function   bsp   requests   ESS   hat   nbsp   alice   

原文地址:https://www.cnblogs.com/liuliu5151/p/11513158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!