This looks quite simple.
Every number ending in 3 follows a pattern.eg-
3 - 111
13 - 111111
23 - 111111111 etc
we can find the reauired no. by :
suppose input no. is 33
In every case leave the no at 1's place(least significant) i.e. 3, In
33 you will be left with 3(after removal of 3 at first place).
Now ,3 *(rest of nos +1 ) is your answer (in case of 33 it is 3*(3+1)
= 12 i.e  111111111111).
for 103 it is 3*(10+1) = 33 1's.

Correct if I am wrong.


On Aug 5, 4:33 pm, Manee <mani.ma...@gmail.com> wrote:
> ADOBE asks the very basic C/C++ questions
>
> one of their toughest however was :
>
> every number ending in 3 has a multiple of the form "111...111"
>
> e.g 3 has 111
>  13 has 111111
> so on..
>
> find the algo for finding the number for an input number ending in 3.
>
> On Aug 5, 2:33 pm, Agyat <jalsa.n.sa...@gmail.com> wrote:
>
>
>
>
>
>
>
> > hey, guys adobe is visiting our campus. So those who know questions
> > that adobe asked in written or interview, please post here as it will
> > be of great help (as adobe has visited some colleges already).
> > Thank you in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to