Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Replicate data over adjacent servers
- Severs
- A B C D
- doc -> Server B # Needs have 2 copies
- [A,B], [B,C]
- Severs
- A B C D
- 2mb 3mb 4mb 2mb
- x = how many copies a doc needs to have
- What is the biggest document you can have x copies of
- -----------------------
- Input:
- Two arrays A and B
- Lower and Upper
- Find the total number of pairs of elements where one element is from A and the other is from B such that
- lower <= A^2 + B^2 <= upper
- Ex)
- A = [1,2,3]
- B = [1,2,3] [1,4,9]
- lower = 3
- upper = 13
- ans = 7 # (1,2),(2,1),(1,3),(3,1),(2,2),(2,3),(3,2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement