+ 1
CHALLENGE:: Combination Of Number
Let A, B, and C are three lists which elements are integer. Their length are vary but they are never empty. There are no 2 same elements in a list. But A,B,C can share same element. Create a program that the outputs are lists that every list contain 1 element of A, 1 element of B, and 1 element of C. But, The output list can't contain double number like [1,3,3] List [1,2,3] is same as [3,2,1] or [2,1,3] or [3,1,2] or [1,3,2] or [2,3,1]. ex: A=[1,2], B=[2,3], C=[3,4] out: [1,2,3], [1,2,4], [1,3,4], [2,3,4]
9 odpowiedzi
+ 15
+ 7
@Krishna Teja Yeluripati Why do you always seek out these challenges and do them in a minute or two? You have a serious addiction that you should get consoling for. 😎
+ 6
So A must be first, then B, then C? So in your ex, 3 could not come first?
+ 3
@Ahmas Fahadg Ilyas wrote: << @Krishna Wow... using html+css+js... cool ^^ >>
Not using html nor css... just pure JS, even for in/output (using prompt() dialog box and document.write() methods, not use of html nor css tabs, no css code at all ;P)
+ 1
@sayan quite close... but there's still a list that has double element if I input A=[1,2], B=[2,3], and C=[3,4].
0
@J.G. It can. For example I took 3 from B, then I can't take 3 from C then I must take 4 from C, and from A I can take 1 or 2. So, it gets [3,4,1] or [3,4,2]. But, as I say that [1,2,3] is same as [1,3,2], etc. So, I write [1,3,4] or [2,3,4] instead.
0
@Krishna Wow... using html+css+js... cool ^^
0
here is mine ahmad...
REVISED VERSION
https://code.sololearn.com/cLY5X1jObdyd/?ref=app
- 1
ha ha
chck now again @ Ahmad
its revised now##