the size of the substring is an important factor~~
if the substring is only a character, it is easy.
if the substring is 2 characters than the big string , it is easy too~~
am i right? :-)
2012/10/18 Ashish Goel ashg...@gmail.com
there is a big string which needs 2GB memory to fit in but you
two month ago , I passed yahoo written test in china.
data structure, algorithm , and given a code segment with some lines
missing, ask you to fill it.
today i rejected yahoo offically. actually i love to be one of yahoo.
finally i chose microstrategy in hangzhou ,china, because it is close
Given a positive number N, find a minimum number M greater than N, M has
the same length with N and the sum of the bits are equal.
example:
N=134 , M=143, // 1+3+4=1+4+3
N=020, M = 101, //2=1+1
the length of N is less than 1000.
--
You received this message because you are subscribed to the
@Ankur ,
as example:
N=134 , M=143, // 1+3+4=1+4+3
N=020, M = 101, //2=1+1
I mean the sum of digits.
2011/10/9 Ankur Garg ankurga...@gmail.com
Is it sum of bits or sum of digits ?
On Sun, Oct 9, 2011 at 1:39 PM, wujin chen wujinchen...@gmail.com wrote:
Given a positive number N, find
?
On Sun, Oct 9, 2011 at 1:39 PM, wujin chen wujinchen...@gmail.comwrote:
Given a positive number N, find a minimum number M greater than N, M has
the same length with N and the sum of the bits are equal.
example:
N=134 , M=143, // 1+3+4=1+4+3
N=020, M = 101, //2=1+1
the length of N is less than
one
cout\nDesired number is iendl; //may abort or continue to find
more
flag = true;
}
}
if(!flag)
cout\nNo such number foundendl;
}
On Oct 9, 5:04 pm, wujin chen wujinchen...@gmail.com wrote:
@Aamir , yes, for some N, it will be no ans, then return -1.
2011/10/9 Aamir Khan ak4u2
hi all,
i will graduate in 2012/5 as a master, and now i am hunting a job.
last week, i got an oral offer from yahoo global RD center in beijing,
( http://beijing.yahoo.com/en/), the formal offer will arrive at the end of
october. does anyone know something about it? i mean the develop
@Dave printf(a=%x, b=%llx,a,b,c); i think c will be ignored~~ , and the
output is a=9,b=10
2011/9/19 Dave dave_and_da...@juno.com
@Wujin: What do you expect the output to be? How does it differ from
what you actually get?
Dave
On Sep 18, 8:47 am, wujin chen wujinchen...@gmail.com wrote
usigned long long x = 0x12345678;
int a = 0x09;
int b = 0x10;
printf(a=%x, b=%llx,a,b,c);
the result is: a=9,b=123456780010
i wonder why~~
can anyone explain it?
thanks.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
sorry , it should be :
usigned long long c = 0x12345678;
int a = 0x09;
int b = 0x10;
printf(a=%x, b=%llx,a,b,c);
2011/9/19 sagar pareek sagarpar...@gmail.com
Check out what u have written...
On Sun, Sep 18, 2011 at 7:17 PM, wujin chen wujinchen...@gmail.comwrote:
usigned long long x
hi all, i encountered this puzzle (http://www.crackpuzzles.com/?p=236):
At one point, a remote island’s population of chameleons was divided as
follows:
- 13 red chameleons
- 15 green chameleons
- 17 blue chameleons
Each time two different colored chameleons would meet, they would change
their
hi Don, i think f(15,14,16) =|15-14|+|14-16|+|16-15| = 1+2+1=4, hou do you
get f(15,14,16) = 5?
2011/9/6 Don dondod...@gmail.com
No, f(15,14,16) = 5.
Don
On Sep 5, 8:33 pm, wujin chen wujinchen...@gmail.com wrote:
hi all, i encountered this puzzle (http://www.crackpuzzles.com/?p=236
agree with hemank !
2011/9/2 hemank lamba hemankla...@gmail.com
Are you sure it is not continuous subsets. Because otherwise i guess it is
a NP problem.
On Fri, Sep 2, 2011 at 7:58 AM, manish kapur
manishkapur.n...@gmail.comwrote:
given an unsorted array of +ve and -ve elements.find a
refer to this :
http://discuss.joelonsoftware.com/default.asp?interview.11.614716
2011/8/27 jai gupta sayhelloto...@gmail.com
@Neha take 42, 21 and 1
42 ^ 1 =43
while 42 ^21 =63
On Fri, Aug 26, 2011 at 10:28 PM, Neha Singh
neha.ndelhi.1...@gmail.comwrote:
Sort the nos., which can be
take a subset from the array, if the average is equal then output the
result.
backtracing can do this.
the time complexity seems not low, any good idea~~?
2011/8/27 sukhmeet singh sukhmeet2...@gmail.com
how to divide an integer array into 2 sub-arrays and make their averages
equal?
array is
i think XOR operator should be used to solve question.
Given the integers in the array A: n1,n2...nk,
we can do this recursively:
XOR all the integers in A, assume the result is F = n1^n2^...^nk,
F must not be 0.
for i-th bit in F from rightmost to left most:
if the i-th bit is 1, halve A
you are an engineer of a search engineering company, such as google.
every search engineering company has a web page warehouse which contains large
numbers of web pages.
and now you have a task, given two search engineerings, say google and
yahoo, estimate yahoo's size of web page warehouse.
you
how about this one?
Node* reverseBy2(Node* head){
Node* p1 = head;
if(p1 == NULL)
return NULL;
Node* p2 = p1-next;
if(p2 == NULL)
return head;
Node* nextHead = p2-next;
p2-next = p1;
p1-next = reverseBy2(nextHead);
return p2;
}
[?]
2011/6/1 Shivaji
@Piyush, how to deal with this case :100 , 10
2011/5/27 Piyush Sinha ecstasy.piy...@gmail.com
we can work out if we sort according to the leftmost integer
On 5/27/11, adityasir...@gmail.com adityasir...@gmail.com wrote:
are you kidding me. Just simple sort wont work.
On Fri, May 27,
given a number n, compute the smallest prime that is bigger than n.
for example, n=8, then the smallest prime that bigger than 8 is 11.
i wonder whether there is an effective way, rather than check every number
bigger than n one by one.
thanks.
--
You received this message because you are
to
check only numbers of the form 6*n - 1 and 6*n + 1.
Dave
On May 17, 9:09 pm, wujin chen wujinchen...@gmail.com wrote:
given a number n, compute the smallest prime that is bigger than n.
for example, n=8, then the smallest prime that bigger than 8 is 11.
i wonder whether
21 matches
Mail list logo