3 ms·
If you add four spaces at the beginning of a line, Hacker News will treat it as preformatted. Here are you tables like such just for ease of reading. --- 1-ba
by jmholla 3y ago
If you add four spaces at the beginning of a line, Hacker News will treat it as preformatted. Here are you tables like such just for ease of reading.
---
1-based first index of v1 in v2 is:
| v1 | v2 | IndexOf(v1,v2) |
|-------|-------------|----------------|
| [] | [] | 1 |
| aba | [] | N/A |
| [] | aba | 1 |
| a | a | 1 |
| a | aba | 1 |
| x | y | N/A |
| world | hello world | 7 |
1-based last index of v1 in v2 is:
| v1 | v2 | LastIndexOf(v1,v2) |
|-------|-------------|--------------------|
| [] | [] | 1 |
| aba | [] | N/A |
| [] | aba | 4 |
| a | a | 1 |
| a | aba | 3 |
| x | y | N/A |
| world | hello world | 7 |
- hermitcrab 3y agoDidn't know that. Thanks!