FastPrepFastPrep
Problem Brief

Card Range Obfuscation Part 4 (ML Eng :)

FULLTIMEOA

🐝 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 🐳

  • Card Range Obfuscation Part 1 (ML Eng :) πŸ¦”
  • Card Range Obfuscation Part 2 (ML Eng :) 🐹
  • Card Range Obfuscation Part 3 (ML Eng :) 🦚
  • Card Range Obfuscation Part 4 (ML Eng :) πŸ₯
  • Part 4

    1Example 1

    Input
    BIN = 424242, N = 2, info = [["0000000000", "5999999999", "VISA"], ["6000000000", "9999999999", "VISA"], ]
    Output
    [["4242420000000000", "4242429999999999", "VISA"]]
    Explanation
    Example 1 illustration
    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!!

    2Example 2

    Input
    BIN = 424242, N = 3, info = [["1000000000", "3999999999", "VISA"], ["5000000000", "6999999999", "VISA"], ["8000000000", "9999999999", "MASTERCARD"],]
    Output
    [["4242420000000000", "4242427999999999", "VISA"],["4242428000000000", "4242429999999999", "MASTERCARD"]]
    Explanation
    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

    Limits and guarantees your solution can rely on.

    🫢
        public String[][] cardRangeObfuscation4(int BIN, int N, String[][] info) {
          // write your code here
        }
        
    Input

    BIN

    424242

    N

    2

    info

    [["0000000000", "5999999999", "VISA"], ["6000000000", "9999999999", "VISA"], ]

    Output

    [["4242420000000000", "4242429999999999", "VISA"]]

    Sign in to submit your solution.