TCS
Company
You have coin of all dimensions. You need to provide exact change at the counter. You have 155p coin. In how many parts will u divide this so that u ll provide the exact change required and carry as less coins as possible.??
Read Solution (Total 7)
-
- Carry 2^0,2^1,2^2,2^3,2^4,2^5,2^6,2^7 denominations. = 1,2,4,8,16,32,64,128. See that you can get any number between 1 and 155 using these denominations. So total 8 denominations
- 13 years agoHelpfull: Yes(16) No(3)
- all you guys dont post careless like this.
its 4 placement of students thats why.please forgive if i am rude.
if we take till 128 then it will exceed 155.
so take 1,2,4,8,16,32,64,28.
i think this is the answer - 13 years agoHelpfull: Yes(9) No(1)
- question should be 255 to satisfy this solution
- 13 years agoHelpfull: Yes(4) No(2)
- method is
various powers of 2...
so it should lyk 1 2 4 8 16 32 64 128 - 13 years agoHelpfull: Yes(1) No(3)
- the strategy for such question is that we should try to split the number as sum of various (2^n - 1) forms.
Let me clarify it from taking an example
for number 155
155 = 127 (= 2^7 -1) + 15 (= 2^4 -1) + 7 (= 2^3 -1) + 3 (= 2^2 -1) + 3 (= 2^2 -1)
now split each of the components as follows
127 = 1+2+4+8+16+32+64
15 = 1+2+4+8
7 = 1+2+4
3 = 1+2
3 = 1+2
so, required denominations are (1,1,1,1,1),(2,2,2,2,2),(4,4,4),(8,8),16,32,64
so, total 18 denominations are required :)
I hope this helps! - 13 years agoHelpfull: Yes(0) No(2)
- according to 2^n, put n = 0,1,2,3,4,5,6...
and the ans comes out to be 8 coins - 13 years agoHelpfull: Yes(0) No(0)
- the awnser is 31
since it has to divided by 5 u divide it by fiv to get 31 so it would be 31 parts - 13 years agoHelpfull: Yes(0) No(3)
TCS Other Question