sum of GP..
a=1
common ratio=4
sum is given=5.6 billion.. find n
simple enough
--
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
^^ ans will be n*30 mins
On Sep 24, 8:40 am, яαωαт Jee anuragrawat1...@gmail.com wrote:
sum of GP..
a=1
common ratio=4
sum is given=5.6 billion.. find n
simple enough
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group
@khattri and khurana:
traverse the string once.
suppose the string is abcdeabcdeabcde
take a hashtable (initially set the items to -1) .now hash as per
khurana's idea till no duplicate occurs.Instead of marking 1. mark the
array index in the hashtable.
so in the hash table, we have
a=0 b=1 c=2 d=3
sorry, for the previous post,
consider this...
iterate the string using variable i
'low' is another variable that stores the index of previous occurrence
of the character+1
initially, i=0 , low=0
max=i-low
abcdedepoiuytu
hashtable :
a= -1 , b= -1, . . . z = -1
a=0
b=1
c=2
d=3
e=4
now, d comes
@ popli: plz change ur email id..placement session will start soon.
On Jul 22, 8:32 pm, Gaurav Popli abeygau...@gmail.com wrote:
an O(n) soln
traveres the array...as you receive odd number put that index in
queuewhen received an even numb check if queue is empty or
not...if queue is