PRIORITY OF NUMBERS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

PRIORITY OF NUMBERS

Read n numbers and give priority of it. Eg., INPUT : 3 1 5 2 4 OUTPUT : 3 1 5 2 4 3 5 1 4 2

29th Nov 2019, 8:13 AM
Kumaresan L
Kumaresan L - avatar
5 Answers
+ 5
This seems much to be an assignment. As such it is advised of you to try it first, and share your code, including explanation where you are stuck, so people can help you effectively and efficiently 👍 Here's how to share links, in case you didn't know yet. https://www.sololearn.com/post/74857/?ref=app
29th Nov 2019, 8:53 AM
Ipang
+ 6
How are you gonna prioritize that number? I mean, what do you wanna prioritize? In your question, you just swap the 5 and 1 and then 4 and 2
29th Nov 2019, 12:08 PM
MCGAmedCoder gamerArtist
MCGAmedCoder gamerArtist - avatar
+ 1
kumaresan How's it going? Have you solved it already? I think I'm getting the idea, I have a code in C. Why don't you post your code so I can see if we were on the same page.
30th Nov 2019, 6:21 AM
Ipang
+ 1
MCGA -Med Coder, Gamer, and Artist Yes, the logic is this, from the given inputs we put rank of given inputs greater wise.. Like In schools they have to give rank to the students as mark wise..
2nd Dec 2019, 7:55 AM
Kumaresan L
Kumaresan L - avatar
0
If you have ranks in code, then sort or prioritize according to rank.. What more needed?
2nd Dec 2019, 10:58 AM
Jayakrishna 🇮🇳