Interview Query

f(x,y) in Interval

Start Timer

0:00:00

Upvote
4
Downvote
Save question
Mark as completed
View comments (6)
Next question

Let

f(x,y)=5x3yf(x,y)=5^x\cdot 3^y

Given an interval [L,R][L,R] and some integer NN. Write a function, get_possible_values, that returns all positive integer pairs (x,y)(x,y) such that f(x,y)[L,R]f(x,y)\in[L,R] and x,y<Nx,y\lt N.

Example:

Input:

L = 0
R = 1
N = 50

Output:

get_possible_values(L, R, N) -> [[0,0]]

Since f(0,0)=1[0,1]f(0,0)=1\in [0,1]

.
.
.
.
.


Comments

Loading comments