This page is a NO-INDEX summary of comments posted in this blog.
Total 849 Comments (26/34 Pages) - Newer Comments - Older Comments
626. 2016-05-19 07:42:47 SebiB90 Comments on C/C++ Coding Exercise - Find the Duplicate Number:
Do not discard your own assumption: "Assume that there is only one duplicate number, find the duplicate one".
627. 2016-05-18 22:34:26 ACMer Comments on C/C++ Coding Exercise - Find the Duplicate Number:
Input [2,2,2,2,2]
2 XOR 2 XOR 2 XOR 2 XOR 2 = 2
1 XOR 2 XOR 3 XOR 4 = 4
2 XOR 4 = 6
628. 2016-05-18 20:29:48 SebiB90 Comments on C/C++ Coding Exercise - Find the Duplicate Number:
There is an O(1) space and O(n) runtime solution. XOR all numbers from 1 to n (inclusive) and XOR all numbers in the array. XOR both and you get the duplicate.
629. 2016-05-18 20:16:11 ACMer Comments on Dynamic Programming - How many ways to connect the pipes?:
yes, it seems your solution is correct. I will correct this later.
630. 2016-05-18 20:01:22 SebiB90 Comments on Dynamic Programming - How many ways to connect the pipes?:
For 5 pipes:
(1, (2, (3, (4, 5))))
(1, (2, ((3, 4), 5)))
(1, ((2, 3), (4, 5)))
(1, ((2, (3, 4)), 5))
(1, (((2, 3), 4), 5))
((1, 2), (3, (4, 5)))
((1, 2), ((3, 4), 5))
((1, (2, 3)), (4, 5))
(((1, 2), 3), (4, 5))
((1, (2, (3, 4))), 5)
((1, ((2, 3), 4)), 5)
(((1, 2), (3, 4)), 5)
(((1, (2, 3)), 4), 5)
((((1, 2), 3), 4), 5)
631. 2016-05-18 19:32:18 SebiB90 Comments on Dynamic Programming - How many ways to connect the pipes?:
F(2)=1
F(3)=2
F(4)=5
F(5)=14
F(6)=42
F(7)=132
F(8)=429
F(9)=1430
F(10)=4862
632. 2016-05-18 19:22:45 ACMer Comments on Dynamic Programming - How many ways to connect the pipes?:
how about f(4)?
633. 2016-05-18 19:21:54 SebiB90 Comments on Dynamic Programming - How many ways to connect the pipes?:
Sorry, wrong calculation. I should not calculate by hand 😀 f(5) = 14 and f(6) = 42.
634. 2016-05-18 19:17:53 SebiB90 Comments on Dynamic Programming - How many ways to connect the pipes?:
f(5) = 12 and f(6) = 35
635. 2016-05-18 19:13:48 ACMer Comments on Dynamic Programming - How many ways to connect the pipes?:
What is your answer for 5 pipes and 6 pipes?
636. 2016-05-18 19:10:26 SebiB90 Comments on Dynamic Programming - How many ways to connect the pipes?:
Let consider 5 pipes. Connect 1 to 2, call it a. Connect a to 3, call it b. Connect 4 to 5, call it c. Connect b and c. In my opinion there is no overlapping. If there is, please tell me where.
637. 2016-05-18 19:07:49 ACMer Comments on Dynamic Programming - How many ways to connect the pipes?:
and you can only place the n+1 th pipe after n-th pipe.
638. 2016-05-18 19:01:28 ACMer Comments on Dynamic Programming - How many ways to connect the pipes?:
f(1) = 0.
the requirement is not to have overlapping connections.
639. 2016-05-18 18:38:24 SebiB90 Comments on Dynamic Programming - How many ways to connect the pipes?:
In my opinion the solution is wrong. In the case of more than 4 pipes, you ignore the possibility to divide the pipes into two subsets of size k and n-k. Let f(k) be the number of possibilities to connect k pipes. Then when dividing as mentioned above, there are f(k) * f(n-k) different possibilities to connect the pipes. To find the correct answer we need to consider each possible partition of the pipes (such that they are continuous, that is only 1 to k and k+1 to n). For convenience lets define f(1) = 1. Then for n >= 2 the formula is f(n) = sum from k=1 to n-1 of f(k) * f(n-k).
640. 2016-05-13 03:52:24 seyedrezabazyar Comments on Coding Exercise – Palindrome Number - C++ - Online Judge:
thanks
very good
641. 2016-05-05 20:37:48 arad Comments on Reverse List/Tuple/String in Python:
thanks
642. 2016-05-03 08:53:43 ACMer Comments on Does TeamViewer Support Multi Screens (Monitors)?:
just tried that, the multiple-monitor hint appears again. It is the second-to-right option in the top-bar.
643. 2016-05-02 16:15:35 ACMer Comments on Google Interview Question - Print Message:
yes, you are right,
typos, corrected.
644. 2016-05-02 16:04:56 Avi Comments on Google Interview Question - Print Message:
Hi,
I am getting a bit confused here . Probably I am wrong, but shouldn't the condition be ?
time - key.first >= 10 // then remove from queue and cache.
645. 2016-05-02 01:31:16 Tim Comments on Does TeamViewer Support Multi Screens (Monitors)?:
I must have answered incorrectly the first time, because I can't see any options now. Maybe I need to uninstall, then reinstall?
646. 2016-05-01 23:49:39 ACMer Comments on Does TeamViewer Support Multi Screens (Monitors)?:
yes, it prompts the first time.
647. 2016-05-01 22:34:09 Tim Comments on Does TeamViewer Support Multi Screens (Monitors)?:
Does this prompt only happen once? I don't see an options to view or select any additional monitors on the system I am accessing.
648. 2016-04-30 13:15:32 Anon Comments on Google Interview Question - Print Message:
Did you cleared the round? As after the phone interview they get back within 2 days.
Best of luck.
649. 2016-04-28 22:45:11 ACMer Comments on Using Imagify Wordpress Plugin to Reduce size of Images:
I don't know what tools/algorithms Imagify use, but I trust jpegoptim since it is open source.
650. 2016-04-28 21:10:35 Julian Comments on Using Imagify Wordpress Plugin to Reduce size of Images:
I am very interested to learn more about it. I learned about Imagify today and I am impressed with the results, and feedback I read over the Internet.
What's your opinion about using Imagify to process the images directly in WordPress vs. using jpegoptim to optimize the images via command line? Could we get similar results than Imagify using jpegoptim? Any comparison, comments or advice?
Newer Comments - Older Comments
–EOF (The Ultimate Computing & Technology Blog) — 46 words