You need to log in or create an account to post to this user's Wall.
liny commented on the post, Excel Sheet Row Numbers 1 year ago
It seems that the original problem can be convert to the further-thought problem by plussing 1 to the set S2, and
get solved quickly.liny commented on the post, Rejection Sampling 1 year ago
I don’t think your code works. For number 10, there are two ways to get it, 7+3 and 6+4, but for number 9, there are three ways to get it, 7+2, 6+3, and 5+4. In a word, their probabilities are not equals.
liny commented on the post, Double Square Problem Analysis 1 year, 1 month ago
void double_square(int x){
// Searhc in a matrix of i rows and j cols. Value of element(i, j) is (i*i + j*j). O(sqrt(x))
int i, j, n, s;
n = (int)sqrt(x);
for(i = n, j = 0; i >= j;){
s = […]- liny mentioned @claxton825 in the forum topic Transformation to Sorted Array in the group Facebook Interviews
I think @claxton825 is right, and then we can use DP.
- liny in the forum topic Find the Minimum Non-Existing Positive Integer in the group Google Interview
int find(int a[], int n){
int i;
for(i = 0; i n; i++){
//Var: elements bgn..i, exclude i, are in the right place or out of range
if(a[i]<1 || a[i]>n){
//Var: out of range
[…] liny commented on the post, Determine If Two Rectangles Overlap 1 year, 2 months ago
It’s better to consider the overlap problem of two lines firstly, because this one is easier to solve and gives good hits to our real problem.
liny became a registered member 1 year, 2 months ago
