FastPrepLargest Value of Usage in Minutes
Problems/Largest Value of Usage in Minutes

Largest Value of Usage in Minutes

Roblox logoRoblox● EasyINTERNOA
QuestionFunctionExamplesConstraints

Problem statement

You are given a list of strings data, where each string is in the form "$device_id, $usage_in_minutes", such that $device_id contains exactly five lowercase English letters ('a'-'z') and $usage_in_minutes contains exactly four digits, representing a positive integer between 1 and 1440 (possibly with leading zeros).

For instance, "abxyz, 0010" describes $device_id = "abxyz" and $usage_in_minutes = 10 minutes.

Given data, your task is to return the $device_id with the largest value of $usage_in_minutes. You may assume that all values of $device_id and $usage_in_minutes are both pairwise distinct in data.

Function

robloxLargestValueOfUsageInMinutes(data: String[]) → String

Examples

Example 1

data = ["iqttt, 0077", "obvhd, 0093", "flohd, 0075"]return = "obvhd"

There are 3 devices, and the largest value of usage in minutes is 93 and it corresponds to devide with id "obvhd".

Constraints

  • 1 <= data.length <= 1400
  • data[i].length = 10
  • device_id.length = 5
  • devide_id[i] ∈ ['a' - 'z']
  • usage_in_minutes.length = 4
  • 1 <= int(usage_in_minutes) <= 1400

More Roblox problems

  • Design Search Autocomplete SystemPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Most Frequent Call Path From Function Trace LogsPHONE SCREEN · Seen Nov 2026
  • Candy Crush Grid Matching and GravityPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public String robloxLargestValueOfUsageInMinutes(String[] data) {
      // write your code here
    }

}
Checking account…