Problem Β· Intervals
Card Range Obfuscation Part 4 (ML Eng :)
Learn this problemProblem statement
π Hi there! The description you are currently reading is just 2nd part of the problem set. It is highly recommended to read ALL THE PARTS before coding as parts may build on top of each other π³
Part 4
Function
cardRangeObfuscation4(BIN: int, N: int, info: String[][]) β String[][]Examples
Example 1
BIN = 424242N = 2info = [["0000000000","5999999999","VISA"],["6000000000","9999999999","VISA"]]return = [["4242420000000000", "4242429999999999", "VISA"]]
Example 1: the two adjacent VISA intervals were merged
Note - I double checked the input & output numbers while uploading, but since there are so many digits, I might count them wrong. If you notice anything wrong, pls feel free to lmk. I am more than happy to modify accordingly. Many thanks in advance! You da best!!
Example 2
BIN = 424242N = 3info = [["1000000000","3999999999","VISA"],["5000000000","6999999999","VISA"],["8000000000","9999999999","MASTERCARD"]]return = [["4242420000000000", "4242427999999999", "VISA"],["4242428000000000", "4242429999999999", "MASTERCARD"]]Example 2: the VISA intervals were extended to fill the gaps, then merged.
Note - I double checked the input & output numbers while uploading, but since there are so many digits, I might count them wrong. If you notice anything wrong, pls feel free to lmk. I am more than happy to modify accordingly. Many thanks in advance! You da best!!
Constraints
π«Ά