subject

Application logs are useful in analyzing interaction with an application and may also be used to detect suspicious activities. A log file is provided as a string array where each entry represents a money transfer in the form "sender_user_id recipient_user_id amount". Each of the values is separated by a space. • sender_user_id and recipient_user_id both consist only of digits, are at most 9 digits long and start with non-zero digit amount consists only of digits, is at most 9 digits long and starts with non-zero digit • Logs are given in no particular order. Write a function that returns an array of strings denoting user_id's of suspicious users who were involved in at least threshold number of log entries. The id's should be ordered ascending by numeric value. Example logs = ["88 99 200", "88 99 300", "99 32 100","12 12 15") threshold 2 The transactions count for each user, regardless of role are: ID Transactions 99 32 There are two users with at least threshold - 2 transactions: 99 and 88. In ascending order, the return array is ('88', '99'). Note: In the last log entry, user 12 was on both sides of the transaction. This counts as only 1 transaction for user 12. Function Description Function Description Complete the function processLogs in the editor below. The function has the following parameter(s): string logs/n): each logsli) denotes the ith entry in the logs int threshold: the minimum number of transactions that a user must have to be included in the result Returns: stringl): an array of user id's as strings, sorted ascending by numeric value Constraints • 1sns 105 • 1 sthreshold sn • The sender_user_id, recipient_user_id and amount contain only characters in the range asci['O'-'9'). • The sender_user_id, recipient_user_id and amount start with a non-zero digit. • 0 < length of sender_user_id, recipient_user_id, amounts 9. • The result will contain at least one element

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Digital information is stored using a series of ones and zeros. computers are digital machines because they can only read information as on or off –1 or 0. this method of computation is known as the system
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Which type of excel chart should be used to track students’ progress on test grades? line column bar pie
Answers: 2
You know the right answer?
Application logs are useful in analyzing interaction with an application and may also be used to det...
Questions
question
Mathematics, 24.05.2021 04:00
question
History, 24.05.2021 04:00
Questions on the website: 13722366