+ 9

<\Challenge> StringCommas

Alright so this challenge is so make The user Input numbers with commas and letters like this: 12:&3ngkao94 And it will output the highest number from what he wrote (in any any language)

12th Jan 2018, 5:09 AM
#X#
#X# - avatar
31 Answers
+ 16
Extract highest number, not highest digit. https://code.sololearn.com/cfXU2ilKBCT7/?ref=app
12th Jan 2018, 7:04 AM
LukArToDo
LukArToDo - avatar
+ 14
Code extract highest digit (oneliner) : https://code.sololearn.com/culXhh7p69kk/?ref=app
12th Jan 2018, 12:47 PM
LukArToDo
LukArToDo - avatar
+ 10
Prints highest number. Hmm... nice challenge 👍 https://code.sololearn.com/c5Zv6Vxc0MX9/?ref=app
12th Jan 2018, 10:55 AM
Justine Ogaraku
Justine Ogaraku - avatar
+ 10
@#X# I just checked it (1,2,3,4) and my code outputs 4. Hope you've not mistaken my code 😐.
12th Jan 2018, 12:24 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 10
@Code learner That's true and everyone code is displaying the highest consecutive numbers
12th Jan 2018, 12:38 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 9
@#X# Okay, you want the code to output the highest digit?? and not consecutive numbers
12th Jan 2018, 12:36 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 9
@#X# Well it's your challenge, I'll post another code, soon. Thanks Edit: Here it is @#X# Python One-linear https://code.sololearn.com/cgU6CC9oe9E9/?ref=app
12th Jan 2018, 12:39 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 8
@#X# It does, give an example case and what it printed out
12th Jan 2018, 11:47 AM
Justine Ogaraku
Justine Ogaraku - avatar
+ 8
What's happening here!! 😭😭😭. I did it and it '1)32g8' and it showed 32. What's wrong.
12th Jan 2018, 12:32 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 2
int max=0; new Scanner(System.in).nextLine().chars().forEach(c->max=Character.isDigit(c)&&c>max?c:max); System.out.print(max);
12th Jan 2018, 5:51 AM
abdulazizumarovich
abdulazizumarovich - avatar
12th Jan 2018, 6:54 AM
#X#
#X# - avatar
12th Jan 2018, 7:49 AM
Sebastián Zapata
Sebastián Zapata - avatar
+ 1
Hey @sebastian Yours didn't work it's printed all the numbers we want it to print the highest number
12th Jan 2018, 8:20 AM
#X#
#X# - avatar
+ 1
@Justine yours doesn't print the highest number....
12th Jan 2018, 11:45 AM
#X#
#X# - avatar
12th Jan 2018, 12:08 PM
code learner
code learner - avatar
+ 1
is my code working?
12th Jan 2018, 12:23 PM
code learner
code learner - avatar
+ 1
I'll try again
12th Jan 2018, 12:26 PM
#X#
#X# - avatar
+ 1
@codelearner yeah it works
12th Jan 2018, 12:27 PM
#X#
#X# - avatar
+ 1
yes it was 32
12th Jan 2018, 12:33 PM
code learner
code learner - avatar
+ 1
Justins code is working fine
12th Jan 2018, 12:33 PM
code learner
code learner - avatar