# Whose rep is tied?

Your challenge is to query the SE API and find out whose rep on PPCG is tied, and output it. If these were all the users on PPCG:

Martin Ender: 10000 rep
Dennis: 10000 rep
xnor: 5000 rep
sp3000: 3000 rep


You should output Martin Ender, Dennis. If these were the only users:

Jon Skeet: 1000000 rep
Martin Ender: 10000 rep
Dennis: 10000 rep
xnor: 5000 rep
sp3000: 3000 rep
Digital Trauma: 2000 rep
Luis Mendo: 2000 rep
Helka Homba: 2000 rep


You should output:

Martin Ender, Dennis
Digital Trauma, Luis Mendo, Helka Homba


Note that you can use different output formats, as long as it is clear whose rep is tied and who they are tied with. Users with <200 rep can be ignored.

• Please consider using the Sandbox in the future to get feedback on your challenges before posting them to the main site.
– user45941
May 10, 2017 at 18:04
• Are we only supposed to get users from PPCG? May 10, 2017 at 18:05
• @HyperNeutrino yes, only PPCG.
– user58826
May 10, 2017 at 18:07
• "Users with <200 rep can be ignored." Can be ignored or should be ignored? May 11, 2017 at 8:49
• When you say we can use different output formats, does that include using something other than their name to identify each user? May 11, 2017 at 15:34

# JavaScript (ES6), 259257248 241 bytes

Returns a Promise object containing \n separated groups, in ascending order of reputation, of profile links for users with the same rep, with each link separated by a comma. As the question only states that users with 200 reputation or less can be ignored (rather than should be ignored), this solution includes a couple of users who do have <200 rep.

f=(x=95,s="",c=0)=>fetch(//api.stackexchange.com/users?page=${x}&site=codegolf).then(a=>a.json()).then(j=>(i=j.items.reverse()).map(x=>(r=x.reputation)>c?(c=r,t.length-1&&(s+=t+ ),t=[x.link]):t.push(x.link),t=[i[0].link])&--p?f(p,s,c):s)  ## Caveat Between this challenge, "Martin vs. Dennis" and a couple of others, I've managed to get myself (temporarily) booted from the API for a few hours! I was, therefore, unable to run my final tests on this but it should be working (although, I suspect it might not include users from page 1 in the output). There's probably a bit more I can golf off it, so I'll come back to it when my ban is lifted. ## Try it WARNING: The first Snippet below will submit 95(!) requests to the SE API - running it a couple of times may result in you also having your access to the API temporarily revoked. If you'd prefer to test this with a reduced number of API calls and, therefore, a reduced result set, change the value of the first parameter to something much lower than 95. Alternatively, you can test it with no API calls, using the second batch of sample data from the question by using the second Snippet below, which returns usernames instead of profile links (for now). f=(x=95,s="",c=0)=>fetch(//api.stackexchange.com/users?page=${x}&site=codegolf).then(a=>a.json()).then(j=>(i=j.items.reverse()).map(x=>(r=x.reputation)>c?(c=r,t.length-1&&(s+=t+
f().then(console.log)
f=(x=95,s="",c=0)=>Promise.resolve(JSON.parse({"items":[{"display_name":"John Skeet","reputation":1000000},{"display_name":"Martin Ender","reputation":10000},{"display_name":"Dennis","reputation":10000},{"display_name":"xnor","reputation":5000},{"display_name":"sp3000","reputation":3000},{"display_name":"Digital Trauma","reputation":2000},{"display_name":"Luis Mendo","reputation":2000},{"display_name":"Helka Homba","reputation":2000}]})).then(j=>(i=j.items.reverse()).map(y=>(r=y.reputation)>c?(c=r,t.length-1&&(s+=t+
f().then(console.log)
• @JohanKarlsson, that won't work due to the \${x} being used to construct the URL. May 11, 2017 at 17:03