Hierarchy is a dictator's first tool for maintaining order and military control. We'll think about a dictatorship later. For now, let's make a list of 10 words. Let's use the keyboard to enter them. Our task is to check whether the list is ordered by increasing string length. If not, we'll display the index of the first element that violates this order.
Checking the order
- 5
Locked
Comments (25)
- Popular
- New
- Old
You must be signed in to leave a comment
Jon Ander Ochoa Ruiz
3 April 2022, 11:46
Hi
I don´t know what´s the problem. The last task is wrong and I don´t know why? Can someone explain me or give me a tip please.
Thank so much
0
John Squirrels Website Admin at CodeGym
4 April 2022, 08:20
Please refer to the Help section.
0
Andrew Evans
2 February 2022, 03:36
Try an i+1 when you print. Task is extremely precise
+1
Anonymous #10781095
2 August 2021, 15:12
Pls iken join fors dis game is cool
0
Davidh Dionicio
24 January 2021, 06:07
A hint, it tells you if the list is in this order according to their increasing length, so if the list has an order of length from least to greatest nothing happens;
but if one of them does not have that order of length less to greater, I mean like:
Then you have to show the index or number of the position that violated that rule, that is:
0
Michael
22 October 2020, 19:59
Very confusing description of the task!
+2
Switch/Cypher
12 September 2020, 18:46
/* Comment has been deleted */
0
andy 6473
14 July 2020, 06:45
This is how they are asking you to compare
0 with 1
1 with 2
2 with 3
and so on
hope this helps
0
andy 6473
14 July 2020, 06:39
roman explain how the output should occur
0
Roman
14 July 2020, 06:45
For input:
output is 2
because:
+2
Jamie Pyette
17 July 2020, 04:40
Hah, respectfully, this still doesnt make sense IMO. In what way is this not ordered
0
Jamie Pyette
17 July 2020, 04:45
Nevermind, I get it now. But probably the most confusing description of a task thus far.
+2
Roman
17 July 2020, 06:14
2. Determine whether the list is ordered by increasing string length.
+1
Jamie Pyette
18 July 2020, 16:35
Determine whether the list is ordered by (the act of) increasing string length....thats how I read it, totally my fault.
Determine whether the list is ordered in a pattern of the strings having increasing lengths...maybe thats too wordy.....anyway, I got er' figured so its all good.
+2
Michael
22 October 2020, 20:03
I read it like"ordered by increasing the length of the string" instead of "ordered by increasing string length"
0
OBINNA
16 May 2021, 01:16
I think the output should be 1. because 'grandmother' is not in order.
The task said the next input should be in order by increased string length.
so 'grandmother' length is the same as 'grandfather' length...so that fails.
the index of the string 'grandmother' is 1.
0
Roman
17 May 2021, 05:11
Ok) Try to sort these strings by increased string length
and show the result) 0
andy 6473
10 July 2020, 16:44
can some one write the output type expected . it is very very confusing
0
Nickolas Johnson
30 March 2020, 13:36
I wrote two different sets of code that both worked and yet only one passed the test. :-/
0