Algorithms, solution methods, comparison of their performance - page 4

 

Add magic: 3, 4, 5, 6
and find the 3rd in the list.

 
Реter Konow:

Then you add three and you get the beginning of the megic.

Why three? Where did that magic number come from?

 
Vasiliy Sokolov:

Why three? Where does that magic number come from?

Because the transaction number is written between two dashes so as not to merge with the magic numbers: " _" + transaction_number + "_"

Combine the 3 characters together.

  1. First we find the line with the number of the deal we want.
  2. Then we add 3 to get the beginning of the megic string. But we don't have the end of the megic.
  3. Find beginning of next trade (our trade + 1) to get the end of the megaxis
  4. Subtract from the start of the next trade line the beginning of the megic line, and obtain the megic line length.
  5. Completely extract megic string from the common string using StringSubstr()
  6. Convert the megic string to int and return it to the user.
 
Реter Konow:

Because the transaction number is written between two dashes so as not to merge with the magician numbers: " _" + transaction_number + "_"

The 3 characters are combined together.

OK, we have recorded the transaction as _847700854723_ where is the number three here?
 
Vasiliy Sokolov:
OK, we have recorded the trade as _847700854723_ where is the number three here?

The overall line looks something like this:

_1_12323452_2_123412_3_23432456_4_123452

The order numbers of the trades are highlighted in red.

In blue, the medians are highlighted.

the number 3 is the number of characters in the trade number substring : _2_

 
Реter Konow:

The general line looks something like this:

The order numbers of the trades are highlighted in red.


For those who are particularly gifted, I ask again: Where is the number three!!! ???? If the sequence number of the deal is _25_ - where here the number is three!?

 
Vasiliy Sokolov:

For the very gifted, I ask again: Where is the number three!!! ???? If the sequence number of the transaction is _25_ - where the number is three!?

The number three is the number of characters in the substring _25_.

It has three characters - a dash, 25 and another dash.

 

Apparently my question has caused a critical error of division by zero in Petya's head. Let's wait for him to reboot...:))

 

The army of MQL blacklisted supporters sincerely thank Reteg Konow for the work he has done in recruiting volunteers.

 
Реter Konow:

The number 3 is the number of characters in the substring _25_

It has three characters - a dash, 25 and another dash.

Peter, are you drunk? In the substring of ..._25_... is four characters: _, 2, 5, _.