Answered step by step
Verified Expert Solution
Question
1 Approved Answer
. Loan Discovery Affirm interacts with merchants, users, and financial institutions to provide consumer loans. When a person borrows from us , we keep track
Loan Discovery Affirm interacts with merchants, users, and financial institutions to provide consumer loans. When a person borrows from us we keep track of the history of events. In this exercise, we will focus on a shortened history to demonstrate some key features of the type of work we do daily. One of Affirm's product is Anywhere, which allows users to take out an installment loan via virtual card. A user applies for a certain amount of money that gets credited to a creditlike card and purchases can be made up to that amount credited on the card. For instance, a user can apply for $ get authorized, and have card that has $ that can be used. Then, the user can buy multiple items that sum up to this amount. The individual items and their sum cannot be larger than this amount. To represent this process, we will utilize the following two events: Authorization Auth Event Before a transaction goes through, this event occurs to ensure that the card has enough funds to continue with a given purchase. Capture Event A merchant signals that a card has been used for a certain amount and the funds are removed from the card. In this scenario, a card can have multiple capture events. For the purpose of this problem we will make a few assumptions: YVY year, MM month, DD day, HH hour, MM minute Auth events will be formatted like YYYYMMDD HH:MM CARD #CARDNUM AUTH AMOUNT such as : CARD # AUTH Capture events will be formatted like YYYYMMDD HH:MM CAPTURE such as : CAPTURE Our key words Card "Capture", "Auth" aren't necessarily always capitalized. For this purpose, there will always be positive auth amounts. However, there may exist negative captures, which may come from errors in our system or the merchant's system. In those cases, ignore negative sums in your calculations. As part of further safety measures at Affirm, we want to start flagging certain users that we might consider "suspect" or might be misusing our product! Help us find some "suspect" users identified through cards that have the following properties: the card with the most valid capture events in nonactive times along with the count of valid capture events in nonactive times Any time is considered "nonactive" if they fall within the timing HH:MM range of :: or ::the card that has the largest captured amount denoted as the sum of amounts from positive capture events along with the total amount captured For instance, if there is an auth of and there are captures then the amount would be since we ignore nonpositive captures the card with the most number of negative capture events along with the count of negative capture events Note that a valid capture event is one that is nonnegative. We can guarantee that there are no ZERO capture events. The input is not guaranteed to be ordered. Cards Ds will be positive numbers. You can assume that an ordered history of events will have every single capture to correspond with the most previous auth at that point in time.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started