USTChucat
BAN USER
Comments (13)
Reputation 35
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-1
of 1 vote
Java encodes String with certain charset. It's ok to keep the encoded password String on the same machine. But if that password String is going to be sent to another machine through network or to be used by other programs, there comes the encoding problem. The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system.
- USTChucat November 27, 2012Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
sort the array, mark the birth year as b, death year as d,
- USTChucat February 07, 2013-80000 b, -79950 d, 20 b, 22 b, 58 b, 60 d, 65 d, 70 d, 1950 b, 2004 d
maintain a map of {year, count}, initially it's {infinite-negative, 0}
loop from the earliest time to the latest time:
if it's a birth year, add count by 1,
it it's a death year, decrease count by 1
{-8000, 1}, {-79950, 0}, {20, 1}, {22, 2}, {58, 3}, {60, 2}, {65, 1}, {70, 0}, {1950, 1},
{2004, 0}
find the corresponding year to the largest count, that's {58, 3}, the next pair is {60, 2}
so from 58-60, there are 3 live dinosaurs