42 Answers
New AnswerWrite 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
10/26/2017 12:47:17 PM
Nikky Amresh42 Answers
New AnswerThanks for the challenge. Here's my try : https://code.sololearn.com/c0ebT2xUiasF/?ref=app
@Shivani I wanted to ask how to add code to lesson we are suggesting to the lesson factory in beta version of sololearn.
@Akash Highlight your code by selecting it, then the options given below will get enabled
@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.
@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
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message