+ 14
🔴CHALLENGE🔴Only increasing↗ or decreasing↘ words!
Write a program in your favorite programming language that receives a string of words from users and outputs only those words whose characters are in increasing or decreading order. Example: input: acer is not a brand for old zoo boys output: acer is not a for old zoo As you may have noticed repeating a character is allowed in increasing and decreasing words. To make it simple, you can change the input to lawercase letters.
24 Answers
+ 12
Here you go :
https://code.sololearn.com/cS1ihver7Z4k/?ref=app
+ 11
Thank you for your challenge.
Here's my try :
https://code.sololearn.com/cHdrJTdk0tvo/?ref=app
+ 10
Here is a typical answer using Java:
https://code.sololearn.com/cEqCRegrqhSi
+ 10
@Ferhat The resean is that the words "brand" and "boys" are neither increasing nor decreasing.
+ 5
Yes I misunderstood, then my answers wrong.
Thanks for challenge anyway.
+ 5
@Codasan first one is fixed. I will try solving second one with generators later. Check if first one is right now. :)
+ 5
@Codasan second one is also fixed now. Check now.
+ 5
One more Python code:
https://code.sololearn.com/c5R91tIMM0ZI/
+ 4
@Sayan your code isn't working well. I tried this:
"acer is not a brand for old zoo boys" and got only
"acer is not a for old zoo" and the words brand and boys are disappeared.
+ 2
oohhooo
@ ferhat
u r seeming to misunderstood the challenge question...
u did...sorted the words
challenge is...
if the words are itself sorted ascending / descending then print them...
like
az za aza
output is
az za
what u did
az
aza
za
za
aza
az
+ 2
Not very pretty, but I think it works.
https://code.sololearn.com/ctq7TUPKgLon/?ref=app
+ 2
Here's my try.
https://code.sololearn.com/c7klNYYoasdk/?ref=app
+ 2
Check out my solution!
https://code.sololearn.com/cJO8FFuZ4BCE/#cpp
+ 2
The version with macros
https://code.sololearn.com/cJjX5VbtQD4I/#cpp
+ 1
herez my one liner...
https://code.sololearn.com/cr253Z1X5iTx/?ref=app
+ 1
😂😂😂
exactly