Question 1
Problem Statement
Given a string s
with uppercase English letters, remove all occurrences of the string "AWS"
until no more remain. After each removal, the prefix and suffix strings are concatenated. Return the final string. If the final string is empty, return -1
as a string.
Example
Input: s = "AWAWSSG"
Process:
"AWAWSSG"
→ Remove"AWS"
→ Result:"AWSG"
"AWSG"
→ Remove"AWS"
→ Result:"G"
Output:"G"
Function Description
Complete the function getFinalString
in the editor below.
Function Parameters:
string s[n]
: A string of uppercase English characters.
Return:
string
: The string after removing all occurrences of"AWS"
or"-1"
if the string becomes empty.
Constraints:
- 1 ≤ |s| ≤ 100,000
- The string contains only uppercase English letters.
Question 2
Problem Statement
As part of data center software development, create a query that returns a list of all Internet gateways that meet the following criteria:
- They have more than one firewall assigned.
- Their assigned firewalls have cumulatively reached the maximum allowed number of traffic rules.
Result Columns:
gateway_id
: Internet gateway ID.total_rules_count
: The sum of all firewall rules for a specific Internet gateway.
Notes:
- Each Internet gateway can be assigned one or more firewalls, while a particular firewall can belong to only one specific Internet gateway.
- Only Internet gateways that have more than one firewall assigned should be included in the result.
- Only Internet gateways whose assigned firewalls have, in total, reached the maximum allowed number of traffic rules should be included in the result.
- The maximum number of traffic rules allowed is 100.
The query should use the provided schema and sample data tables.
我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。
We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.