ܕܒܕ For two positive integers, lo and hi, and a limit k find two integers, a and b, satisfying the following criteria. R
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
ܕܒܕ For two positive integers, lo and hi, and a limit k find two integers, a and b, satisfying the following criteria. R
ܕܒܕ For two positive integers, lo and hi, and a limit k find two integers, a and b, satisfying the following criteria. Return the value of ab. The symbol denotes the bitwise XOR operator. • losa<bshi • The value of a bis maximal for a @bsk Example Jo 3 hi=5 k=6 а Ф b a b 3 7 3 5 6 4 5 1 The maximal useable XoRed value is 6 because it is the maximal value that is less than or equal to the limit k-6. Function Description Complete the function maxtor in the editor below. The function must return an integer denoting the The first line contains an integer, lo, the lower range limit. The second line contains an integer, hi the upper range limit. The third line contains an integer, k the maximal limit Sample Case o Sample Input o STOIN Function 1 3 3 lo ht k. 3 Sample Output Explanation The following are the possible values of a and b satisfying losa<bsht • 1-2-3 • 10-3-2-2 • 3-26-3-b. The maximum possible value of absis 3 Sample Cases Sample Input 1
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!