+ 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)
31 Answers
+ 16
Extract highest number, not highest digit.
https://code.sololearn.com/cfXU2ilKBCT7/?ref=app
+ 14
Code extract highest digit (oneliner) :
https://code.sololearn.com/culXhh7p69kk/?ref=app
+ 10
Prints highest number.
Hmm... nice challenge 👍
https://code.sololearn.com/c5Zv6Vxc0MX9/?ref=app
+ 10
@#X#
I just checked it (1,2,3,4) and my code outputs 4. Hope you've not mistaken my code 😐.
+ 10
@Code learner
That's true and everyone code is displaying the highest consecutive numbers
+ 9
@#X#
Okay, you want the code to output the highest digit?? and not consecutive numbers
+ 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
+ 8
@#X#
It does, give an example case and what it printed out
+ 8
What's happening here!! 😭😭😭. I did it and it '1)32g8' and it showed 32. What's wrong.
+ 2
int max=0;
new Scanner(System.in).nextLine().chars().forEach(c->max=Character.isDigit(c)&&c>max?c:max);
System.out.print(max);
+ 1
Here how I did it in C#
https://code.sololearn.com/cF5WyujMg1W4/?ref=app
+ 1
Hi :)
My code:
https://code.sololearn.com/cGRGnZ2woAc2/?ref=app
+ 1
Hey @sebastian Yours didn't work it's printed all the numbers we want it to print the highest number
+ 1
@Justine yours doesn't print the highest number....
+ 1
is my code working?
+ 1
I'll try again
+ 1
@codelearner yeah it works
+ 1
yes it was 32
+ 1
Justins code is working fine