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 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 24.06.2019 18:10
Most information security incidents will occur because of select one: a. users who do not follow secure computing practices and procedures b. increases in hacker skills and capabilities c. poorly designed network protection software d. increasing sophistication of computer viruses and worms
Answers: 1
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, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
question
Mathematics, 10.05.2021 18:00
Questions on the website: 13722363