+ 19
🏆🏆[Challenge] Write a program to write code🏆🏆
Write a program which can minimize the duplicates value of an array.. You have to minimize code not array .. For example... Input : a=['a67', 'b68', 'j24', 'k25', 'a67', 'b68' ,'a67', 'b68', 'j24', 'k25', 'a67', 'b68']; output : needs to return a[0],a[4],a[6],a[10]=a67 a[1],a[5],a[7],a[11]=b68 a[2],a[8]=j24 a[3],a[9]=k25
42 Answers
+ 13
Thanks for the challenge.
Here's my try :
https://code.sololearn.com/c0ebT2xUiasF/?ref=app
+ 9
https://code.sololearn.com/cowQKT92ux8z/?ref=app
Here's my answer 😊
+ 6
@Harshit Yes, I'm a beta tester
+ 6
@Shivani I wanted to ask how to add code to lesson we are suggesting to the lesson factory in beta version of sololearn.
+ 6
@Akash Highlight your code by selecting it, then the options given below will get enabled
+ 6
@Akash Don't you know how to select text?
+ 5
I don't understand it
+ 5
@Kartikey If you are a beta tester. Can I ask you how to add code when we are writing a lesson in lesson factory. The Option given below are not working. How can I add code and notes? Please tell me.
+ 4
hello)))
+ 4
https://code.sololearn.com/cJB2k6ALiOKM/?ref=app
C++ is here!
+ 4
@Harshit 😂😂
+ 4
@Kartikeya some hint pls
+ 4
are you in the beta program
+ 4
I got invited but update has not arrived yet
+ 4
@Harshit
If the array contains [1, 2, 1, 2, 3]
Do a loop that reads every element
Do a second loop inside first one to check if there is any duplicate value and store it into any temporary array which prints all its values when an iteration of first ends and gets empty when new iteration of first loop start.
Don't forget to do something that checks whether you have already printed the index of value
+ 3
nikky
+ 3
well I am a slow learner don't mind
+ 3
Plz can you explain me it in more
+ 3
can I be given just a hint with c++