+ 19
🏆🏆#Challenge:help bob to solve bit-byte cracking number puzzle.
🏆🏆🤔🤔🏆🏆 in office bob is bored & he play with the binary number but he do not get the answer he want your help. problem: bob has 16-bit binary number and he want to know how many 4-bit binary number pair is possible to do: T1:num pair is even T2:num pair is odd T3:num pair is prime T4:num pair is div by 2 ✅Test case✅ num:1010101010101010 if pair:1010 1010=10(Decimal) 10 is even so even pair +1 like that all pair check output: evenpair:? oddpair:? prime pair:? div by 2 pair:? All language accepted
10 ответов
+ 12
here is my try:
https://code.sololearn.com/cixRBZkR118e/?ref=app
+ 11
here you all need first find maximum possible set of 4bit binary number from 0000 to 1111 total 16 pair is possible then you check for the perticuler pair is available in the given 16-bit binary number if true then perform a particular task set that given in question!!
thank you all likers,commenter and code submission related programmer!!
👍👍
+ 10
hello @@Louis,
Max possibility of 4-bit binary number pair:
0000-0
0001-1
0010-2
.........
.........
1101-13
1110-14
1111-15
total=16 pair is possible
Now you want to check all this possible pair is available in 16-bit number and if available than check for particular condition available in question
Thank you for your question!!
👍👍
+ 10
hope this is correct. https://code.sololearn.com/ckBtchDhQctK/?ref=app
+ 9
you just count all no matter what is differ and all that
T1,T2,T3,T4 all pair count
@Louis it is for Medium level users so level of difficulty here you understand clearly
thank you for your questions!!
👍👍
+ 9
@Sachin,
whole output??
above in que i clearly explained what should you do
and
suppose num is
1010101010101010
then you work with some mathematics and number theory to find the maximum possibility of pair from particular number
here
totol:16-bit num
pair limit:4-bit
you just find how many pair is possible and every pair check for particular given condition in que
after some mathematics and calculation you find what actually questions and all that
@@Sachin,
thank you for your questions
👍👍
+ 8
thank you all for your interest and if you have any doubt about problem-questions then feel free to ask here!!
😊😊
+ 7
What should be the whole output, for 1010101010101010?
+ 6
How does
T1: num pair is even
differ from
T4: num pair is div by 2?
+ 6
Please give a complete example for
1001 0110 0101 1010