Java Variables - Part 2 - String & int - #w3schools #java #programming

preview_player
Показать описание
This video is an introduction to Java Variables. Part 2 of 8.

Part of a series of video tutorials to learn Java for beginners!

The page this is based on:
Run Java in your browser:
Get your own Java server:

Find W3Schools here:

Join this channel to get access to perks:
Рекомендации по теме
Комментарии
Автор

Yes, I can understand the content of the questions based on the images you provided. Here are the two coding questions:

### 1. **Error Log Extraction**
You are required to develop a function that processes a stream of log data from AWS CloudWatch, represented as a 2D array of strings called logs. Each inner list contains the following log information: the year, date, time, status, and message.

The task is to return all logs with `ERROR` or `CRITICAL` status, sorted by their time of arrival. If two logs arrive at the same time, return them in the order that appears first in logs.

- The log date is in `DD-MM-YYYY` format, and the log time is in `HH:MM` format.

**Example:**
```python
logs = [["01-01-2023", "14:00", "ERROR", "failed"],
["01-01-2023", "15:00", "INFO", "established"],
["01-01-2023", "01:30", "ERROR", "failed"]]

# Expected Output:
# [[1, "01-01-2023", "01:30", "ERROR", "failed"],
# [0, "01-01-2023", "14:00", "ERROR", "failed"]]
```

### 2. **Application Analytics**
You are tasked with designing an application analytics system that keeps track of actions performed in the application. The system uses a given integer `K`. When the number of registered actions becomes equal to `K`, the system sends these actions to an `Analytics Store`.

- The actions are represented using an enum called `ActionsEnum`.
- Implement the following methods:
- `registerAction(ActionEnum action)`: Registers an action.
- Returns the total number of actions done.
- Returns the most frequently used actions sorted lexicographically by enum string values.
- Returns the number of actions that have been registered but not yet sent to the analytics store.

Let me know if you need further clarifications or help with the solutions!

piyushjain
join shbcf.ru