Question: Uber | February 2025 | Online Assessments | Uber Security Team | Kingdom of Eldoria
0
Entering edit mode

Question 1: Uber Security Team (Strong Password Checker)

Problem Statement:

Uber's security team is working on password security for the employees. For setting up a password, the guidelines mentioned by them are:

  1. Minimum 6 characters and maximum 20 characters.
  2. At least one uppercase letter, one lowercase letter, and one digit.
  3. Should not contain any three contiguous repeating characters. Example: mmmbq is weak but mmbmq is strong.

You are given a password string s as the input. You need to tell us the minimum number of iterations (steps) you would need to make it an UBER strong password. If you think your password is already passing all the checks, then return 0.

In one step, you can:

  • Insert a character to the password.
  • Delete a character from the password.
  • Replace a character of the password with another character.

Constraints:

  • Password consists of letters, digits, dot . or exclamation mark !.

Example:

Input:

"abc"

Output:

3

Output Explanation:

The minimum password length required is 6, so you need to add 3 characters to your password. Here, you would need to add one uppercase, one digit, and one random character of your choice.

Question 2: Kingdom of Eldoria (Royal Vault Heist)

Problem Statement:

In the kingdom of Eldoria, a legendary royal vault holds priceless jewels, secured behind multiple chambers. Each chamber is protected by complex security systems, and each chamber has a different security level. A group of elite thieves plans to steal the jewels, but they are limited by the time they have to disable the security systems. The jewel value and time to disable the security systems increase with the security level of each chamber.

Your task is to help the thieves maximize the total jewel value they can steal within a given time limit, where each chamber can only be robbed once.

The jewel value and time to disable the security system for each chamber depend on the security level. Specifically:

  • Jewel Value: The effective jewel value in each chamber is the base jewel value multiplied by the security level of the chamber.
  • Time to Disable: The actual time to disable the security system is the time to disable multiplied by the security level of the chamber.

Input Format:

  • integer n: Number of chambers.
  • integer t: Total time available for the heist.
  • array.array.integer m: For each of the n chambers, you are given: [Security Level, Base Jewel Value, Time to Disable].

Output:

Return the maximum total jewel value the thieves can steal within the total time limit.

ADD COMMENTlink 2 days ago Aman • 0

Login before adding your answer.

Similar Posts
Loading Similar Posts