Hacker News new | past | comments | ask | show | jobs | submit | randv's comments login

super cool...thanks


Always read all articles with writers motivation/agenda in mind. this is why I like research / tech articles that are thoroughly backed by data or math!


- it is turning the number into a string of 1s 3 => 111 4 => 1111 and so on

- then trying to simulate divisibility test by trying to find perfect groups of '11' to simulate division by 2 failing which (that is the backtracking part) and trying find perfect groups of '111' to simulate division by 3 and so on...

Clever but very inefficient


while compact and looks elegant...

it is basically trying to group by 11 (divide by 2), if there no match (via backtracking) group by 111 (divide by 3) and so on

not very efficient by any stretch esp with string matches.


steps:

- it is turning the number into a string of 1s 3 => 111 4 => 1111 and so on

- then trying to simulate divisibility test by trying to find perfect groups of '11' to simulate division by 2 failing which (that is the backtracking part) and trying find perfect groups of '111' to simulate division by 3 and so on...

Clever but very inefficient


nothing is returned from function s?


the only usage of the "s" function is down in T(i), and the "i" parameter passed to T() is ignored anyway ("for (i = X + rand() % X;"). It's just needed to save a int i; in the function itself.


I observed this when I was back in school using a simpler expression i = 0; i = i++;

the answer will be different in different compilers. I use this as an interview question ever since, not to get the right answer but to understand the candidates thought process in solving the problem and his/her understanding of operator precedence :-)


I dont know your level, for someone like me who studied mathematics years ago but not applied it for years, I found "In pursuit of unknown, 17 equations that changed world" by Ian Stewart very helpful. While it is not a detailed math book, it gave me enough pointers to refresh and prepared me to dive deeper through other material.


finding the search on contacts has never been easy on iphone!


$40 mil revenue is largely from their products and services on the network management and element management side (called AdventNet). They are not exactly a typical startup.


Not sure what you mean. Which successful (non-acquired) startup do you consider typical?


I agree with the unrestricted donation part. My money went MSF primarily because they had a staff of more than 700 people before the earth quake struck and knew how to help the country.


For me, MSF's draw has always been their great accountability, much lower overhead and coverage that extends beyond those 50/100/200-year natural disasters.


Agreed. MSF is the only large charity I would consider donating too.


Yes, agreed. MSF is great and who I donated to as well.


What's MSF?


"Médecins Sans Frontières [Doctors Without Borders] is an international, independent, medical humanitarian organisation that delivers emergency aid to people affected by armed conflict, epidemics, healthcare exclusion and natural or man-made disasters."

From the website: http://www.msf.org/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: