+ 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.

24th Nov 2017, 8:38 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
24 Answers
1st Dec 2017, 1:35 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 11
Thank you for your challenge. Here's my try : https://code.sololearn.com/cHdrJTdk0tvo/?ref=app
24th Nov 2017, 9:43 PM
LukArToDo
LukArToDo - avatar
+ 10
Here is a typical answer using Java: https://code.sololearn.com/cEqCRegrqhSi
24th Nov 2017, 9:00 PM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
+ 10
@Ferhat The resean is that the words "brand" and "boys" are neither increasing nor decreasing.
25th Nov 2017, 8:44 AM
Vahid Shirbisheh
Vahid Shirbisheh - avatar
24th Nov 2017, 9:02 PM
David Akhihiero
David Akhihiero - avatar
25th Nov 2017, 8:09 PM
Alex V. S.
+ 5
Yes I misunderstood, then my answers wrong. Thanks for challenge anyway.
25th Nov 2017, 8:52 AM
Ferhat Sevim
Ferhat Sevim - avatar
+ 5
@Codasan first one is fixed. I will try solving second one with generators later. Check if first one is right now. :)
25th Nov 2017, 9:10 AM
Ferhat Sevim
Ferhat Sevim - avatar
+ 5
@Codasan second one is also fixed now. Check now.
25th Nov 2017, 1:20 PM
Ferhat Sevim
Ferhat Sevim - avatar
26th Nov 2017, 3:12 PM
Alex V. S.
+ 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.
25th Nov 2017, 8:33 AM
Ferhat Sevim
Ferhat Sevim - avatar
+ 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
25th Nov 2017, 8:47 AM
sayan chandra
sayan chandra - avatar
+ 2
Not very pretty, but I think it works. https://code.sololearn.com/ctq7TUPKgLon/?ref=app
26th Nov 2017, 3:57 AM
JaredM
27th Nov 2017, 6:47 AM
tVrd
tVrd - avatar
27th Nov 2017, 4:29 PM
Petros Simidyan
Petros Simidyan - avatar
27th Nov 2017, 4:51 PM
Petros Simidyan
Petros Simidyan - avatar
25th Nov 2017, 5:04 AM
sayan chandra
sayan chandra - avatar
+ 1
😂😂😂 exactly
25th Nov 2017, 8:44 AM
sayan chandra
sayan chandra - avatar