我有一个带有8个外键的事实表(引用8个维度),但即使是所有8个键的组合也不能唯一地标识一行.我是否需要从原始数据中添加另一个属性(即"project-id"属性,这对任何事情都没用),这样我就可以拥有主键,或者我可以保留事实表,而不需要主键?
问题如下:
You are given two arrays of integers a and b, and two integers lower and upper.
Your task is to find the number of pairs (i, j) such that lower ? a[i] * a[i] + b[j] * b[j] ? upper.
Example:
For a = [3, -1, 9], b = [100, 5, -2], lower = 7, and upper = 99, the output should be boundedSquareSum(a, b, lower, upper) = 4.
There are only four pairs that satisfy the requirement:
If …Run Code Online (Sandbox Code Playgroud)