16
2
Challenge
Given the name of a PPCG member, output their PPCG ID number. If the user does not exist, you may report an error or return any non-positive number. If there are multiple members with this name, you may choose to output only one ID or all of them.
Test Cases
"musicman523" -> 69054 "Dennis" -> 12012 "xnor" -> 20260 "Leaky Nun" -> 48934 "fəˈnɛtɪk" -> 64505 "Jörg Hülsermann" -> 59107 "Community" -> -1 "Any user that does not exist" -> 0 "Alex" -> 69198 (this is one possible result) "Leaky N" -> 0 "Jorge" -> 3716
Sandbox – musicman523 – 2017-08-07T13:54:09.910
If there are multiple users with the same name, can we output any one of them? – Okx – 2017-08-07T13:56:16.210
@Okx Yes, any of them is fine – musicman523 – 2017-08-07T13:58:01.373
Related – Oliver – 2017-08-07T14:07:38.763
1Recommended test case: "Leaky N". Should return 0. – Okx – 2017-08-07T14:12:16.760
5Can our program result in undefined behaviour for inexistent users (mine prints 48934, for example for a non-existing user)? I think this should be allowed, since errors are. – Mr. Xcoder – 2017-08-07T14:14:49.133
1@Mr.Xcoder The question states that If the user does not exist, you may report an error or return 0. I think you have your answer. – Okx – 2017-08-07T14:16:03.793
4@Okx No, I don't. I am asking the OP if this behaviour is allowed. If it is not, I will delete or fix my answer. – Mr. Xcoder – 2017-08-07T14:16:38.727
@Mr.Xcoder Sorry, how does that not answer your question? – Okx – 2017-08-07T14:19:20.360
1@Okx Sorry, can you please not be so toxic here? I see your point, but you could be a little nicer about it. – Oliver Ni – 2017-08-07T14:21:26.770
3@OliverNi Toxic? How? – Okx – 2017-08-07T14:22:00.533
5@Okx He is asking a valid question to the OP and you are shooting him down immediately. Let the OP answer. – Oliver Ni – 2017-08-07T14:22:32.930
@Mr.Xcoder You can do anything besides return a positive integer. This includes (but is not limited to) throwing an exception, returning 0, returning a negative number, etc. – musicman523 – 2017-08-07T15:07:47.357
@musicman I fixed my answer. – Mr. Xcoder – 2017-08-07T15:09:59.793
I wonder if this could be answered with a Stack Exchange Data Explorer query...
– Stevoisiak – 2017-08-07T15:30:52.177@StevenVascellaro Done and done.
– totallyhuman – 2017-08-07T15:44:28.6831Recommended test case: "Jorge". Should return 3716 (as of right now) – Felipe Nardi Batista – 2017-08-08T12:06:51.060