We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Output n lines. The ith line should contain the value of fâ1(i).
but if f(3) = 8, n = 3, so if f(n) were to = n+5 or a million other possible functions, and you're searching for g(3), when inputs are 6,7,8... am I missing something? this whole problem is screwing with my head. Doesn't seem like there's enough information given to solve this 100% of the time for functions other than the identity function. Also srsly what is testcase #3, glitch isn't allowing me to buy it.
edit - eventually 'solved' the question. I guess it's assumed that all elements of X are also elements of Y, even though it doesn't appear to be stated in the question.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Security Function Inverses
You are viewing a single comment's thread. Return to all comments â
Output n lines. The ith line should contain the value of fâ1(i). but if f(3) = 8, n = 3, so if f(n) were to = n+5 or a million other possible functions, and you're searching for g(3), when inputs are 6,7,8... am I missing something? this whole problem is screwing with my head. Doesn't seem like there's enough information given to solve this 100% of the time for functions other than the identity function. Also srsly what is testcase #3, glitch isn't allowing me to buy it.
edit - eventually 'solved' the question. I guess it's assumed that all elements of X are also elements of Y, even though it doesn't appear to be stated in the question.