text:
Making Sandwiches
Introduction
Bob runs a deli. His deli serves sandwiches to its customers. However, it is a bit unusual. At Bob's deli, instead of telling Bob what they want, customers show Bob an ASCII art drawing of their sandwich. Bob must find the pattern in their sandwich so he knows what ingredients to prepare. However, Bob does not like picking out patterns. He wants you to write a program to help him do that.
Challenge
You must write a function which, given the filling of a sandwich, will output a list of ingredients for Bob to prepare. You must find the pattern of ingredients in the filling, then output that pattern.

Input will be a string. It will never be empty, and it will only contain printable ASCII characters (characters 32 to 255). If your language has no method of input, input can be taken in the form of command line arguments or stored in a variable.
Output must be a string. If your language has no method of output (or you are running a function, not a full program) you may output through return code or through a variable.

Example I/O

Input: |&|&|&|&
Output: |&
Input: :&|:&|:&|
Output: :&|
Input: ((&|((&|((&|((&|
Output: ((&|

Rules
This is code-golf, so shortest answer wins!

@JoKing - The challenge has been modified. Now contestants must simply find the pattern in a string.

Will the input always be a string repeated multiple times?

@xnor - yes, you can assume that.

Is |&|& a valid answer for the first example input?

Related and related (those are to check if a substring is repeated with a truthy/falsey result; whereas this challenge asks for the substring itself).

Bob makes a special deli where he reads patterns, but hates reading patterns. Bob is an excellent metaphor, for what I'm not sure.

"will only contain printable ASCII characters (characters 32 to 255)" That's not ASCII. ASCII goes only as far as 127, and the last printable character is 126. So do you mean that we can assume that all characters will be between 32 and 126 or that we have to consider other charset which goes to 255?

looks slightly related; definitely not a similar/dupe though. Just for those curious.

Python, 28 bytes
lambda s:s[:(s+s).find(s,1)]

Try it online!
The length of the output is the first nonzero position starting from which s can be found in the doubled s+s.
For example:
s   = abcabcabc

s+s = abcabcabcabcabcabc
         abcabcabc
         ^
         s starting at position 3 (zero-indexed)

46 bytes
f=lambda s,p='':p*(s+p==p+s)or f(s[1:],p+s[0])

Try it online!

This is very clever

05AB1E, 3 bytes
η¢Ï

Try it online!
η     # prefixes of the input
 ¢    # count the number of occurences of each one within the input
  Ï   # filter the input, keeping only indices where the above is 1

Prefixes that stop short of the last repetition of the pattern can be found multiple times in the input, offset by a pattern-length. Thus, this ends up keeping only the last repetition of the pattern.

Jelly, 5 bytes
Ḋ;wḣ@

Try it online!
A slightly modified version of xnor's answer. Method: Given S, concatenates Swithout the first character with S, then finds the index of S in this new string, then takes the head.

JavaScript (ES6), 25 bytes
s=>/(.+?)\1*$/.exec(s)[1]

Try it online!
Regular expression
   +-------> 1st (and only) capturing group: 1 or more character(s), non greedily
   |   +---> reference to the capturing group, repeated 0 to N times
  _|_  | +-> end of string
 /   \/ \|
/(.+?)\1*$/

Find any characters, followed by that match repeated 0 or more times. Execute that regex on the input and return the first capture group?

@Pureferret The regular expression will match 1 or more characters (except newlines) in a non-eager way, and will match that captured group of characters at least 0 times until the end of the string. The anonymous function will return the value in the key 1 in the resulting array from the exec method of the regular expression. This works because if .+? matches any number of characters, and (.+?)\1* ensures that whatever is left is exactly the same as the capturing group or nothing at all ($). Check https://regex101.com/r/r1iXY6/1 for a much better explanation.

@IsmaelMiguel is that not what I said (just less clearly)?

@Pureferret And more accurate. Which is the problem with my explanation :/ But Arnauld added a good explanation.

J, 22 15 bytes
{.~1+]i.~#$&><\

Try it online!
No regex solution:
{.~                      NB. take from the input this many chars:
    1 +                  NB. 1 plus...
          i.~            NB. the first index of...
        ]                NB. the input in this list:
                    <\   NB. every prefix of the input...
                $&>      NB. cyclically repeated to...
              #          NB. the size of the input.

I could shave off two more bytes using a xnor's wholly different approach, but for the sake of variety I'll leave my original as the  answer:
{.~1{]I.@E.,~

Try it online!

Icon, 50 bytes
procedure f(s)
return s[1:1+find(s,s[2:0]||s)]
end

Try it online!
An Icon port of xnor's Python solution. Don't forget to upvote his answer!

Perl 5 (-p), 15 bytes
s/(.+?)\1*$/$1/

Try it online!

C (clang), 72 bytes
f(char*s){int n=1,p=1;while(s[p]|p%n)s[p]^s[p%n]?p=++n:++p;puts(s+p-n);}

Try it online!
Explanation:
The algorithm is a simple brute force search, checking whether the entire string is a repetition of a pattern of length n=1,2,3,…. The non-golfed implementation could be as follows:
void f(char* s)
{
    // try pattern length=1,2,3…
    for (int n = 1; ; n++)
    {
        // loop over the string (until null terminator) to see if
        // it's a repetition of the pattern
        int p = n;
        for (; s[p]; p++)
        {
            if (s[p] != s[p%n])
            {
                // not a repeating pattern
                break;
            }
        }

        if (!s[p]) {
            // we've reached the end of the string, so it seems to be
            // a repeating pattern… but it's not a valid solution
            // if the pattern is cut off in the middle ("cutoff case"):
            // e.g. abc-abc-abc-ab
            if (p % n == 0)
            {
                // print and return: we can simply output the *last*
                // occurrence of the pattern, because it is followed
                // by the null terminator
                puts(s + p - n);
                return;
            }
        }
    }
}

The golfed version is doing this in a single loop:
f(char* s)
{
    int n=1,p=1;
    while (s[p]|p%n)
        // more verbosely, s[p] || (p%n != 0)
        // - Loop while we haven't reached the null terminator.
        // - If we have, keep going if p is not a multiple of n
        //   (i.e. in the cutoff case).
    {
        s[p]^s[p%n]?p=++n:++p;
            // more verbosely,
            // if (s[p] != s[p%n]) { n++; p = n; } else { p++; }
            // - If the pattern is not repeating, increment the pattern
            //   length n and start over. This also applies in the cutoff
            //   case; in that case s[p] is the null terminator.
            // - Otherwise increment p and continue checking the string.
    }
    puts(s+p-n);
}

69 using for statement and  n,p default to int

Perl 6, 16 bytes
{m/(.+?))>$0+$/}

Try it online!
Standard regex solution, finding a non-greedy match that repeats for the whole string

Jelly, 6 bytes
sJEƇḢḢ

A monadic Link accepting a list of characters which yields a list of characters.
Try it online!
How?
sJEƇḢḢ - Link: list of characters, S
 J     - range of length (S) = [1,2,3,...,length(s)]
s      - (S) split into chunks (of each of these sizes)
   Ƈ   - filter keep those for which:
  E    -   all equal?
    Ḣ  - head
     Ḣ - head

Retina, 12 bytes
(.*?)\1*$
$1

Try it online!

Red, 51 bytes
func[s][copy/part t: append copy s s find next t s]

Try it online!
A Red port of xnor's Python solution. Don't forget to upvote his answer!
Using parse:
Red, 71 bytes
func[s][n: 0 until[n: n + 1 parse s[copy t n skip any t]]copy/part s n]

Try it online!

05AB1E, 6 bytes
η.ΔKõQ

Try it online or verify all test cases.
Or alternatively:
«¦sk>£

Try it online or verify all test cases.
Explanation:
η       # Get the prefixes of the (implicit) input-string
 .Δ     # Get the first prefix which is truthy for:
   K    #  Remove all occurrences of this substring in the (implicit) input-string
    õQ  #  And check if what remains is an empty string
        # (after which the found prefix is output implicitly as result)

«       # Append the (implicit) input-string with itself
 ¦      # Remove the first character
  sk    # Get the (0-based) index of the input-string in the earlier created string
    >   # Increase this by 1 to make it a 1-based index
     £  # And only leave that amount of leading characters from the (implicit) input-string
        # (after which this is output implicitly as result)

Turns out there's a 3 (:

@Grimmy Oh, that approach is brilliant. :D Very nice find.

Brachylog, 3 bytes
ġ≡ᵛ

Try it online!
ġ      Split the input into substrings of equal length
 ≡ᵛ    such that each substring is the output.

Python 3, 46 bytes
lambda s:re.match(r"(.+?)\1*$",s)[1]
import re

Try it online!

Since the challenge has been changed, this answer is no longer valid.

@sugarfi its okey, i updated my answer :)

Ruby -p, 18 bytes
~/(.+?)\1*$/
$_=$1

Try it online!

Japt, 7 bytes
¯ÒU²ÅbU

Try it
¯ÒU²ÅbU     :Implicit input of string U
¯           :Slice to 0-based index
 Ò          :  Bitwise increment
  U²        :    Duplicate U
    Å       :    Slice off the first character
     bU     :    First index of U

Alternative/Original
Since posted by Aztecco.
ã æ@¶îX

Try it
ã æ@¶îX     :Implicit input of string U
ã           :Substrings
  æ         :First element that returns true
   @        :When passed through the following function as X
    ¶       :  Test U for equality with
     îX     :  X repeated to length of U

Seen your answer just after posting mine!

@AZTECCO, I'll update with my alternative 7 byte solution momentarily and you can have this one.

@AZTECCO, updated.

Ok then I undelete mine, thank you @Shaggy

Japt, 7 bytes
ã f@¥îX

Try it
U.ã(). // all substrings
f( // filtered by..
function(X, Y, Z) { return U == U.î(X) }) // item repeated till input.length == input

SimpleTemplate 0.62, 184 bytes
Yeah ... This is a very long one ...
It highlights the weaknesses of that specific version (check below for version 0.72).
{@setI 0}{@setC""}{@setA argv.0}{@do}{@setO"{@setc A.",I,"}"}{@callimplode intoO O}{@evalO}{@setC C,c}{@callimplode intoC C}{@incI}{@callstr_replace intoR C,"",A}{@untilR is""}{@echoC}

This is a huge mess, here's the ungolfed one:
{@set index 0}
{@set chars ""}
{@set arg argv.0}

{@do}
    {@set code "{@set char arg.", index, "}"}
    {@call implode into code code}
    {@eval code}
    {@set chars chars, char}
    {@call implode into chars chars}

    {@inc by 1 index}
    {@call str_replace into result chars, "", arg}
{@until result is equal to ""}

{@echo chars}

Yes, those 5 lines inside the {@do} only do 2 things:

Get the character at the position of the index value.
Add the character into the variable chars, as a string.

You can test the golfed and ungolfed versions on http://sandbox.onlinephpfunctions.com/code/7f2065a193d2bd0920cc3a4523e4b0ebf7a72644

Version 0.72, 112 bytes
This non-competitive version uses new features I've developed today, to allow me to do more with the language.
First, here's the code:
{@setX}{@setC""}{@do}{@setC"#{C}#{argv.0.[X]}"}{@incX}{@callstr_replace intoR C,"",argv.0}{@untilR is""}{@echoC}

It looks like a mess! Lets clear it up:
{@set index 0}
{@set chars ""}

{@do}
    {@set chars "#{chars}#{argv.0.[index]}"} {@// NEW IN 0.72}
    {@inc by 1 index}
    {@call str_replace into result chars, "", argv.0}
{@until result is equal to ""}

{@echo chars}

Most of this has been explained in other answers, so, I will focus on this line: {@set chars "#{chars}#{argv.0.[index]}"}.
This showcases 2 new features in the language and a bugfix:

Now you can get a value from an array based on the value of a variable
Now there's string interpolation, where "#{chars}" will interpret the chars variable and the result is a single string.
Before, you would have to do {@set chars chars, value2, ...}, which makes an array instead of a string.
Previously, you could only access 1 member of an array/string. Currently, you can access as many deep in as you want. This meant that {@echo argv.0.0} would need to be written as {@set arg argv.0}{@echo arg.0}.

The line {@set chars "#{chars}#{argv.0.[index]}"} replaces the previously mentioned lines inside the {@do}.
You can try this on http://sandbox.onlinephpfunctions.com/code/e2ab3d10c8224ee475cf4d4ca94fef7896ae2764

Non-competing isn't a thing anymore. Unless you added the new features specifically for this challenge, in which case the solution is invalid.

@Shaggy Got any meta links for that? If you do, once presented, I will delete the answer. And no, I added those for all challenges in the future. This was more for me to "test the waters". So many challenges were impossible (like this one) without those changes.

The way in which @Shaggy is claiming this might be invalid is by violating this standard loophole, however adding new general features after a challenge is OK. See here for the meta post abolishing non-competingness.

@pppery None of those apply. This language has been used at least 15 times by me, on other challenges, over the last 2 years. The features I've added are for my language aren't made so I could use it in this specific challenge, but features I've been wanting to implement for a very long time. I just used this challenge to test them out, and decided to post the test as an answer. Previously, this type of challenge would have been almost impossible. I could change my {@set chars "#{chars}#{argv.0.[index]}"} line into something extremelly convoluted, that wouldn't be worth the time [...]

[...] spent on the challenge, when there were answers that are 3-10 bytes long and do it well. To make that line work previously, I would have to do it in 3x the length, at least. It isn't something specific for this challenge, but for future usage of the language. To write that single line, I would have to write {@call implode into code "{@set char argv.0.", index, "}"}{@eval code}{@call implode into chars chars, char}, or similar. just to be able to do this type of challenge.

I will just make it into a competing answer, ut I don't care about the reputation win/loss from it.

There, wrote my answer with the previous version, with a link to the commit and places to test the code.

GolfScript, 10 bytes
..2*1>\?)<

Try it online!
Explanation
.          # Make a copy of the initial input
 .2*       # Make another copy that has a double length
    1>     # Trunctuate the copy to without the first item
      \    # Swap the copy to below
       ?   # Find the index of the input
        )  # Increment the index
         < # Slice the input so that the whole section emerges

Husk, 6 bytes
↑¹€tD¹

Try it online! Yet another port of xnor's answer.

Vyxal, 6 bytes
dḢ?ḟ›Ẏ

Try it Online!
Yet another port of xnor's answer

Charcoal, 10 bytes
…θ§⌕Ａ⁺θθθ¹

Try it online! Link is to verbose version of code. Adaptation of @xnor's answer. Explanation:
     ⁺θθ    Duplicate the input
   ⌕Ａ   θ   Find all indices of the input
  §      ¹  Skip the first index, which is always zero
…θ          Truncate the input to that length
            Implicitly print

Wren, 37 bytes
Basically a port.
Fn.new{|a|a[0..(a+a).indexOf(a,1)-1]}

Try it online!

R, 33 36 bytes
sub("(.+?)\\1*$","\\1",scan(,""))

Try it online


text:
Spanning tree of a rectangular grid
Background
A spanning tree (Wikipedia) of an undirected graph is a subgraph that is a tree which includes all of the vertices of the original graph. The following is an example of a spanning tree of a 4-by-4 grid graph.

Task
Given two positive integers w and h, output any valid spanning tree of the grid graph which has w vertices horizontally and h vertices vertically. There are lots of valid answers; just output one of them. Your code is even allowed to give different outputs across runs, as long as all of them are valid.
Input and output
The input is two positive integers w and h.
The output is a representation of a spanning tree. The output format is restricted to "a list of pairs of numbered vertices", in order to prevent various boring answers (as discussed in the sandbox). Also, the vertex numbering should be in row-major order, e.g.
0 - 1 - 2 - 3
|   |   |   |
4 - 5 - 6 - 7
|   |   |   |
8 - 9 - 10- 11

or
(0,0) - (0,1) - (0,2) - (0,3)
  |       |       |       |
(1,0) - (1,1) - (1,2) - (1,3)
  |       |       |       |
(2,0) - (2,1) - (2,2) - (2,3)

You can choose to use 0-based or 1-based indexing for vertices. Also, you may output nested or flattened arrays.
Scoring & winning criterion
The standard code-golf rules apply. The shortest valid submission in bytes wins.
Example I/O
w=3, h=2
If you want to output the following graph
+-+-+
| |
+ +-+

The list-of-vertex-pairs representation will be (using 0-based indexing for example):
[(0, 1), (0, 3), (1, 2), (1, 4), (4, 5)]

or
[((0, 0), (0, 1)),
 ((0, 0), (1, 0)),
 ((0, 1), (0, 2)),
 ((0, 1), (1, 1)),
 ((1, 1), (1, 2))]

w=1, h=1
The graph is a single vertex with no edges, and its only spanning tree is the graph itself. Your code should output an empty list (which means no edges).

Does rule anything prevent us from always zig-zagging through the array? E.g. 0 → 1 → 2 → 3 ↓ 7 ← 6 ← 5 ← 4 ↓ 8 → 9 → 10 → 11

@Adam It doesn't, as far as I see. You can also simply use, for example, a vertical line combined with many horizontal ones.

Can we input h and w in unary? Can we input them as a grid made of a specific character?

@someone Unary: yes, but only if it's the most natural representation of a positive integer in your language of choice. Grid input: no.

K (ngn/k), 9 bytes
|\'2':+!:

Try it online!
this is a composition equivalent to the lambda {|\'2'+!x}. the trailing : forces ! (and therefore the whole composition) to be monadic.
 !2 3         /odometer
(0 0 0 1 1 1
 0 1 2 0 1 2)
 +!2 3        /flip
(0 0
 0 1
 0 2
 1 0
 1 1
 1 2)
 2':+!2 3     /pairs (sliding window size 2)
((0 0;0 1)
 (0 1;0 2)
 (0 2;1 0)
 (1 0;1 1)
 (1 1;1 2))
 |\'2':+!2 3  /cumulative(\) max(|) each(')
((0 0;0 1)
 (0 1;0 2)
 (0 2;1 2)
 (1 0;1 1)
 (1 1;1 2))

Python 2, 46 bytes
lambda w,h:zip(R(w-1)+R(w*h),R(1,w*h))
R=range

Try it online!
49 bytes
lambda w,h:[(i-w**(i>=w),i)for i in range(1,w*h)]

Try it online!
Both of these produce a list corresponding to a spanning tree like this (for w=4, h=3):
0--1--2--3
|  |  |  |
4  5  6  7
|  |  |  |
8  9  10 11

APL (Dyalog Extended), 12 bytesSBCS
Full program. Prompts for [h,w] from stdin. Prints pairs of [y,x] coordinates.
2⍮/,↑⊢∘⌽\↓⍳⎕

Try it online!
⎕ prompt for numeric input from the console
⍳ an array of those dimensions containing the ɩndices of an array of those dimensions
↓ split into list of rows
⊢∘⌽\ boustrophedonise
↑ combine rows into matrix
, ravel matrix into list
2⍮/ adjacent pairs (lit. for every overlapping run of 2 elements, juxtapose the 2 elements)

⌈\¨2,/⊂¨,⍳⎕ is 11. i believe you can shorten it even more with your extensions.

@ngn Another clever ngn-scan! But it has no connection to my solution, and even makes a different tree. Go ahead and post ⌈\¨2⍮/,⍤⍳ in Extended.

https://codegolf.stackexchange.com/questions/195408/spanning-tree-of-a-rectangular-grid/195488#195488

APL (Dyalog Extended), 9 bytes
⌈\¨2⍮/,⍤⍳

Try it online!
Adám's golfing of my algorithm

05AB1E, 12 10 bytes
*L©¹<Lì®¦ø

-2 bytes by porting @xnor's Python 2 answer, but is 1-based instead. So it will output the graph in this format (i.e. w=5, h=3):
1--2--3--4--5
|  |  |  |  |
6  7  8  9  10
|  |  |  |  |
11 12 13 14 15

Try it online.
Explanation:
*           # Multiply the (implicit) width and height inputs with each other
 L          # Create a list in the range [1,w*h]
  ©         # Store this list in variable `®` (without popping)
   ¹<       # Push the width-input again, and decrease it by 1
     L      # Create a list in the range [1,w-1]
      ì     # Prepend it in front of the earlier list
       ®    # Push the list [1,w*h] from variable `®` again,
        ¦   # and remove the 1 to make it the range [2,w*h]
         ø  # Zip/transpose to create pairs of the two lists
            # (after which this list of pairs is output implicitly as result)

Original 12 bytes answer:
*LIä2Å€R}˜ü‚

1-based. Will output the graph in this format (i.e. w=5, h=3):
1--2--3--4--5
|
6--7--8--9--10
            |
11-12-13-14-15

Try it online.
Explanation:
*             # Multiply the (implicit) width and height inputs with each other
 L            # Create a list in the range [1,w*h]
  Iä          # Split it into the height-input amount of equal-length parts
    2Å€ }     # Apply to every 2nd (index % 2 == 0) item:
       R      #  Reverse the inner list
         ˜    # Then flatten it to a single list of integers again
          ü   # Apply to each overlapping pair of values:
           ‚  #  Pair them together
              # (after which this list of pairs is output implicitly as result)

R, 42 bytes
function(w,h)cbind(a<-1:(h*w-1),a+w^!a%%w)

Try it online!
Creates the spanning graph
1-2-3
    |
4-5-6
    |
7-8-9

Node i is connected to node i+1 in general, or to node i+w if i is a multiple of w. This corresponds to a connecting node i to node i+w^d where d=1 if i is a multiple of w, and d=0 otherwise.

Nice that this method's solution for a 3x3 traces out a 3.

Rockstar, 215 bytes
g takes w,h
let j be 0
while j is less than h
let i be 0
while i is less than w
let c be j*w+i
let p be c-1
if i is 0
let p be c-w

if p is as high as 0
say "("+p+"-"+c+")"

build i up

build j up

It can be invoked like
g taking 3,2

with the output as
(0-1)
(1-2)
(0-3)
(3-4)
(4-5)

you can also try it online!

Ruby, 44 41 bytes
crossed out 44 is still 44
->w,h{(1...w*h).map{|x|[x,x+=x%w<1?w:1]}}

Try it online!
1-based solution

Scala 3, 49 bytes
Attempt This Online!
(w,h)=>((0 to w-2)++(0 to w*h-1)).zip(1 to w*h-1)

The output IndexedSeq[(Int, Int)]) is corresponding to a spanning tree like this (for w=4, h=3):
0--1--2--3
|  |  |  |
4  5  6  7
|  |  |  |
8  9  10 11

Charcoal, 22 bytes
ＮθＮηＦ×θη¿ιＩ⟦⎇﹪ιθ⊖ι⁻ιθι

Try it online! Link is to verbose version of code. Outputs using the following format:
0-1
|
2-3
|
4-5

Alternative solution, also 22 bytes:
ＮθＮηＦ×θη¿ιＩ⟦⎇‹ιθ⊖ι⁻ιθι

Try it online! Link is to verbose version of code. Outputs using the following format:
0-1
| |
2 3
| |
4 5

Bonus version:
ＮθＦＮＦθ«Ｊ⊗κ⊗ι¿∧κ∨¬ι‽←+-↑✂+|⁰⊕ι

Try it online! Link is to verbose version of code.

JavaScript (V8), 68 bytes
Takes input as (w)(h). Prints pairs of 0-based numbered vertices.
w=>g=(h,n=0,p=n)=>((n/w&1?n--:++n)%w?n:n=p+w)<w*h&&g(h,n,print(p,n))

Try it online!
Recursively creates the following pattern (here with \$w=4\$):
 0→ 1→ 2→ 3
          ↓
 4← 5← 6← 7
 ↓
 8→ 9→10→11
          ↓
   … ←14←15

Jelly, 9 bytes
×ḶsUÐeFṡ2

Explanation:
×ḶsUÐeFṡ2 the main and only link, takes the dimensions as input
×         multiply the dimensions
 Ḷ        create the range of 0..h*w-1
  s       split into chunks of length w, I have no idea how does this part refer to w
    Ðe    at even indices
   U      reverse the chunks
      F   flatten
       ṡ2 split in overlapping slices of length 2 (path -> edge list)

The tree is actually a snake-like path:
01234
98765
ABCDE

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Fastest N times Hello World (Java/C/ C++)
Not a new one:
Input
N, being n, 0 ≤ n ≤ 5.
Output
N times "Hello World."
Example:
Input
3
Output
Hello World.
Hello World.
Hello World.

These 2 are my best solutions:
First
public class Out
{
    public static void main(String[] a) throws Exception
    {
            java.io.OutputStream o = System.out;
            byte n = Byte.parseByte(new java.io.BufferedReader(new java.io.InputStreamReader(System.in)).readLine());
            for(byte i = 0;i<n;i++){
                o.write("Hola mundo.\n".getBytes());
            }
    }
}

Second
public class Out
{
    public static void main(String[] a) throws Exception{
        byte n = Byte.parseByte(new java.io.BufferedReader(new java.io.InputStreamReader(System.in)).readLine());
        while(n>0){switch(n){case 0: w();break;case 1: w();break;case 2: w();break;case 3: w();break;case 4: w();break;case 5: w();break;}n--;}
    }

    static void w() throws Exception{
        System.out.write("Hola mundo.\n".getBytes());
    }
}

According to the server it is being tested on ( im not an owner of that server), first attempt gives me 0.006ms and 622 KiB while second attempt gives me same time with 625 KiB.
I am not able to provide the Java version being used but if you want, feel free to use the main site ( spanish language ) https://www.aceptaelreto.com/problem/statement.php?id=116
P.S.: Some peoeple were able to get it on 0.005ms and 88KiB.
edit:
-this code is being benchmarked on the link used before.
-The point is to get the fastest code ( and if possible, with the least amount of memory used), not the shortest one.
Apparently Im not able to use comments since I do not have the required reputation score.

How did you benchmark your code?

Is it [tag:fastest-code] as the title and body suggests, or [tag:code-golf] as you've tagged it?

Do you understand that of the 6ms all but a few microseconds is the program loading overhead?

This is a poor-quality question per @someone's comment above, and I've downvoted it, but it's not closeworthy, either as unclear or for lacking a winning criterion.

Yeah I think it should not be closed. But just improve the question.

C++11 approach (Time: 3.6 µs on some Intel i7, File size of a.out: 28K) compiled via:
clang -O3 -march=native -Ofast golf.cpp: (Clang 6.1)
#include <iostream>
#include <chrono>
#include <sstream>

int main(int argc, char** argv) {
  auto t1 = std::chrono::high_resolution_clock::now();
  const int n = 5;
  if (n < 0 || n > 5) return 1;
  std::stringstream ss;
  for (size_t i = 0; i < n; i++) ss << "Hello world\n";
  std::cout << ss.str();
  auto t2 = std::chrono::high_resolution_clock::now();
  auto duration = std::chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();
  std::cout << duration << "µs" << std::endl;
  return 0;
}

One could add the check for the n you specified, but this feels boring.

Using C (size <12 KiB, time < 0.001s)
$ cat >hola.c <<END_C
#include<unistd.h>
int main(){
  int i,n;
  read(0,&n,1);
  for(i='0';i<n;++i){
    write(1,"Hola mundo.\n",12);
  }
}
END_C

$ gcc hola.c -o hola

$ wc -c hola
11944 hola

$ time ./hola <<<5
[...]
real    0m0.001s
user    0m0.000s
sys     0m0.000s

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Identify the Eeveelutions
Gah! It's a shame that Pokémon Sword and Shield won't introduce a new eeveelution. Let's mourn them with a code golf.
The objective is to, when given a type name as the input, output the name of the corresponding eeveelution.

When given Water, output Vaporeon.
When given Electric, output Jolteon.
When given Fire, output Flareon.
When given Psychic, output Espeon.
When given Dark, output Umbreon.
When given Grass, output Leafeon.
When given Ice, output Glaceon.
When given Fairy, output Sylveon.
All other input falls in don't care situation.

No other rules. Enjoy!

Such a shame indeed. So many good types left for the Eeveelutions, like Ghost, Poison, Flying, Dragon, Steel, etc. Instead we get an Eevee the size of a house and a hotdog-sized cat (Meowth).. >.> Btw, I assume both the input and output is case-sensitive (titlecased), but you may want to mention it explicitly just in case.

Pyke, 29 bytes
EF 73 77 59 25 54 25 75 09 60 84 58 22 23 61 82 73 82 72 00 24 52 40 7E 5F 39 39 73 EF

Try it here!, Ungolfed with full tests
.o                                           -      map(ord, input)
  s                                          -     sum(^)
   wY%T%                                     -    (^ % 57) % 10     // wY is 57
                                   R@        -    v[^]
        u\t`\x84X"#a\x82s\x82r\x00$          -   [96, 600, 34, 35, 97, 371, 370, 0, 36]
                                     ~_99s   -  ^ + 333333 + 99
                                          .o - dictionary_lookup(^)

We start off by converting the input to a list of integers corresponding to the ascii characters and then summing them. This produces the following set of numbers for ["Water", "Electric", "Fire", "Psychic", "Dark", "Grass", "Ice", "Fairy"]: [515, 811, 390, 723, 386, 512, 273, 507]. We then perform a magic operation ((x % 57) % 10) to get the following list of offsets: [2, 3, 8, 9, 4, 6, 5, 1].
The bytes below correspond to the following compressed list: [96, 600, 34, 35, 97, 371, 370, 0, 36], and we index into it based on the offsets we had previously. There's a 0 in there due to my inability to get it not to wrap.
75 09 60 84 58 22 23 61 82 73 82 72 00 24

Try it here!
This list of numbers corresponds to the location in the Pokedex, minus 100. Pyke's dictionary handily contains the Pokedex starting from index 333333 (0 indexed). It also comes with a convenient default variable, ~_, for getting that particular number. We then add 99 to it to take an offset to Pyke's dictionary, and then use .o to look up that particular word.

Even shorter than 05AB1E? What language is this?

I mostly used it when I was more active a few years ago but I kind of forgot about it (last real commits 2 years ago now). It's got quite a few extremely esoteric functions, and Pokemon finding was one of them^^
Link to some info: https://codegolf.meta.stackexchange.com/a/8627/32686
Mini instructions that are poorly written: https://codegolf.meta.stackexchange.com/a/9636/32686

Python 2, 77 76 bytes
lambda s:'VFULJSGEalmeoylspaballaporrftvc'[hash(s)%3695%8::8]+'reon'[s<'V':]

Try it online!
In Python 2, the hash function consistently (across runs and also on different platforms) converts any immutable value into a 64-bit integer. By taking that integer first mod 3695, then mod 8, we get an integer 0<=i<8 (3695 was found by brute force checking all possible values upto 10000).
A common trick is used to encode a list of same-size strings into a single string and then using slicing via [i::8]to extract the strings without using .split or similar strategy. Only two options are not of length 4: Esp and Vapor. The former is handled by making it the last of the 8 strings encoded; and Vapor is handled using the final slicing 'reon'[s<'V':].

How does hash work in this?

@EdgyNerd : I added a little explanation.

Perl 6, 72 67 65 64 bytes
{<Sylv Esp Glac Jolt Leaf Umbr Flar Vapor>[:36($_)%537%8]~'eon'}

Try it online!
A golf to all unique indexes by parsing the string as base 36 and moduloing it. I've left a version that just uses the sum below so other answer that may not have the same short base converting code that Perl 6/Raku does. There is also base 35 with modulo 51 and 10, but that comes out to the same byte count.
Perl 6, 67 bytes
{<Leaf Esp Umbr Vapor 0 Sylv Flar Jolt Glac>[.ords.sum%64%9]~'eon'}

Try it online!
Differentiates between inputs by the sum of the ordinal values, modulo 64 modulo 9, leaving one extra spot to be filled in. Unfortunately, my brute force script couldn't find any pairs of moduli that led to no empty spaces, and adding a third would cost more than it gained.

Ah, everyone's favourite Eeveelution: 0eon :P

Brb, off to catch a Nulleon

Ruby -p, 89 67 bytes
Direct port of Jo King's Perl answer. By sheer coincidence, the byte count is even the same. The byte counts are no longer the same as Jo King has switched to using a technique that cannot be tersely replicated in Ruby.
$_=%w"Leaf Esp Umbr Vapor 0 Sylv Flar Jolt Glac"[$_.sum%64%9]+'eon'

Try it online!
Original Version, Ruby -p, 89 bytes
Basic lookup checking the first letter of the input (or first 2 if the second letter is i, which is only present in Fire).
$_=%w"WVapor EJolt PEsp DUmbr GLeaf IGlac FSylv FiFlar".find{|e|e.sub!$_[/.i?/],''}+'eon'

Try it online!

ink, 111 110 bytes
=e(t)
{
-t?"W":Vapor
-t?"E":Jolt
-t?"P":Esp
-t?"y":Sylv
-t?"D":Umbr
-t?"G":Leaf
-t?"I":Glac
-1:Flar
}<>eon->->

Try it online!
Explanation
=e(t)          // Define a stitch e which takes a parameter t
{              // An if block - finds the first condition that is true and doeses the associated thing
-t?"W":Vapor   // If "W" is a substring of our parameter, we print "Vapor"
-t?"E":Jolt    // otherwise, if "E" is a substring of our parameter, we print "Jolt"
-t?"P":Esp     // "P" is for "Psychic"
-t?"y":Sylv    // We can't check "F" for "Fairy" because that'd also match "Fire", but since we got past "Psychic", "Fairy" is the only option that contains "y"
/* et cetera */
-1:Flar        // If we get here, we check if 1 is truthy (it is) and if so, we print "Flar"
}<>eon->->     // Append "eon" to the last line printed, and return.

05AB1E, 47 40 38 bytes
.•‡ιÏSnÛ@¥I´4óÈ¬–[и)h‘j"õújв•#ć«™sÇ<Oè

-7 bytes by porting @JoKing's ord-sum % 64 trick.
-2 bytes thanks to @JonathanAllan by using the ord-sum - length on the input-type instead.
Try it online or verify all test cases.
Explanation:
.•‡ιÏSnÛ@¥I´4óÈ¬–[и)h‘j"õújв•
            "# Push compressed string "eon glac  jolt leaf umbr esp vapor sylv flar"
  #          # Split it on spaces:
             #  ["eon","glac","","jolt","leaf","umbr","esp","vapor","sylv","flar"]
   ć         # Extract head; pop and push remainder-list and the first item
    «        # Concat this first item "eon" to each string in the remainder-list
     ™       # Titlecase each Eeveelution
      sÇ     # Get the input, and convert it to a list of unicode values
        <    # Decrease each value by 1
         O   # Sum these integers
          è  # And use this to (0-based) index into the list (with automatic wrap-around)
             # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress strings not part of the dictionary?) to understand why .•‡ιÏSnÛ@¥I´4óÈ¬–[и)h‘j"õújв• is "eon glac  jolt leaf umbr esp vapor sylv flar".

Would doing sum of ordinal-values + length be shorter than modulo 64? (You'd need to change the order of your compressed list to the one in my Jelly answer - rotated to be 0-indexed)

@JonathanAllan Thanks, that indeed saved 2 bytes (after I noticed it should be ord-values MINUS length instead of plus. ;) You've also made that same typo in your own answer. Took me a bit to notice you're decrementing by 1 instead of incrementing by 1, after I debugged your code to see why my port didn't work, haha). Thanks for the -2, though.

Oops, sorry and thank you!

Charcoal, 50 bytes
§⪪”↶2'⧴mＢ⁼“↷⁻o⊟ＨtωhJ№↘Tθ⁼σ4Þχ℅)Zh” ⌕rtFhDscy§Ｓ⁴eon

Try it online! Link is to verbose version of code. Explanation:
§⪪”↶2'⧴mＢ⁼“↷⁻o⊟ＨtωhJ№↘Tθ⁼σ4Þχ℅)Zh”

Split the compressed string Vapor Jolt Flar Esp Umbr Leaf Glac Sylv on spaces and index into it using...
⌕rtFhDscy§Ｓ⁴

... the index of the fourth character of the input (taken cyclically) in the string rtFhDcsy.
eon

Output the shared suffix.

By "fourth" you mean zero-indexed fourth?

@DannyuNDos Yes, Charcoal uses zero-indexing.

Java 8, 84 bytes
t->"Leaf Esp Umbr Vapor  Sylv Flar Jolt Glac".split(" ")[t.chars().sum()%64%9]+"eon"

Port of @JoKing's Perl answer.
Try it online.

Jelly, 43 bytes
“ȦF³ḢẎŻṣ>[ɲ$Ɱ'⁻⁹ḋm¿:ṪœeḂɲẆy$\»Ḳ;€“°9»ŻɓO’Sị

Try it online! Or see the test-suite.
How?
First makes the list ['Jolt', 'Leaf', 'Umbr', 'Esp', 'Vapor', 'Sylv', 'Flar', 'Glac'], adds 'eon' to each, and prepends a zero to the list. Then gets the ASCII code-points of the characters in the input list, subtracts one from each, sums those up and indexes into the created list (using 1-based, modular indexing - i.e. gets the value at index i%9).

Julia 1.0, 85 83 75 bytes
f(s)=strip("VUEJGSFLamsolylepbplalaaor tcvrfr"[6hash(s)%47%8+1:8:33])*"eon"

Try it online!

Perl 5 -p -MList::Util=pairfirst, 84 bytes
$_=(pairfirst{/$a/}D,Umbr,E,Jolt,Fa,Sylv,Fi,Flar,G,Leaf,I,Glac,P,Esp,W,Vapor)[1].eon

Try it online!

Misdealt with Fairy.

Thanks.  Accidentally left that case out.  Got it now.

C (gcc), 103 bytes
I hash the first four bytes of the string to determine the index into the array (the hash function is not optimal, but works well enough: there's probably a more efficient one, but it would likely be bigger!) After the index is computed, I then print the four (or five) characters of the prefix and end with "eon". It's more compact than a string array, and by keeping the five-character string at the end I simplify the indexing.
I used some quirks in the language and implementation to save some length:

Due to operator precedence, I use 4|j>7 to give me 4 or 5, as bitwise operators have a lower precedence than relational ones.
Strings have to have int-appropriate alignment and int has to be a 32-bit, little-endian value so I can use type punning on the input string; fortunately this is the case for the test environment.

j;f(int*i){(j=(*i-2)%12%10)&&j--;printf("%.*seon",4|j>7,"SylvEsp\0JoltFlarLeafUmbrGlac    Vapor"+4*j);}

Try it online!


text:
ASCII Pumpkin Carving
Today is Halloween and it's time to carve some pumpkins!
   &
((^.^))

Given an input integer, string, list of integers, etc., output the corresponding pumpkin. The input will always be of the form Stem, Eyes, Mouth, Width. For example, 2331 would be a valid input.
The pumpkin takes the form:
   S
((EME))

where S is the stem, E are the eyes, M is the mouth, and the parens form the body.
Definitions
Stem:
0 for a curl &
1 for a straight |
2 for a slant left \
3 for a slant right /
Eyes:
0 for angled ^
1 for small dots .
2 for medium dots o
3 for large dots O
Mouth:
0 for angled v
1 for small dot .
2 for medium dot o
3 for large dot O
Width:
0 for a skinny pumpkin (only one pair of parens)
1 for a fat pumpkin (two pairs of parens)
Examples
0011
   &
((^.^))

3100
   /
 (.v.)

2331
   \
((OOO))

1200
   |
 (ovo)

Rules

Input/output can be given by any convenient method.
You can print it to STDOUT or return it as a function result.
Either a full program or a function are acceptable.
Any amount of extraneous whitespace is permitted, provided the characters line up appropriately.
You must use the numbering and ordering of the pumpkin carvings as they are described above.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Quite similar to Do you want to code a snowman?.

@manatwork Hmm, that is kinda similar. I'll leave it up to the community to determine if that's a dupe target or not.

Add++, 56 bytes
L,"&|\/^.oOv.oO ((("4$Tz£:BF"("+@32C3*$+Bh$2D-1A:1+")"*J

Try it online!
Add++ is not the best at string manipulation challenges
How it works
We create an lambda function that takes a single argument - a list of integers - and outputs the final pumpkin.
L,                    - Define our function. Takes in a four element list e.g. [0 0 1 1]
                                                       STACK = [[0 0 1 1]]
  "&|\/^.oOv.oO ((("  - Push this string               STACK = [[0 0 1 1] '&|\/^.oOv.oO (((']
  4$T                 - Split it into 4 pieces         STACK = [[0 0 1 1] ['&|\/' '^.oO' 'v.oO' ' (((']
  z                   - Zip the lists together         STACK = [[['&|\\/' 0] ['^.oO' 0] ['v.oO' 1] [' (((' 1]]]
  £:                  - Index into each string         STACK = [['&' '^' '.' '(']]
  BF                  - Flatten the stack              STACK = ['&' '^' '.' '(']
  "("+                - Append a "(" to last element   STACK = ['&' '^' '.' '((']
  @                   - Reverse stack                  STACK = ['((' '.' '^' '&']
  32C3*$+             - Prepend 3 spaces to stalk      STACK = ['((' '.' '^' '   &']
  Bh                  - Output stack with newline      STACK = ['((' '.' '^']
  $2D                 - Push from under                STACK = ['((' '^' '.' '^']
  -1A:1+              - Add one the the last argument  STACK = ['((' '^' '.' '^' 2]
  ")"*                - Repeat ")" that many times     STACK = ['((' '^' '.' '^' '))']
  J                   - Join together                  STACK = ['((^.^))']
                      - Implicitly output

JavaScript (ES6), 78 bytes
(s,e,m,w)=>`   ${'&|\\/'[s]}
${' ('[w]}(${(e='^.oO'[e])+'v.oO'[m]+e})`+' )'[w]

Try it online!

Python 3, 96 87 86 84 bytes
lambda s,e,m,w,a="^.oO":" "*(2+w)+"&|\/"[s]+"\n"+"("*-~w+a[e]+"v.oO"[m]+a[e]+")"*-~w

Try it online!
Thanks to:
- @79037662 for saving me 2 bytes

Is the 1* necessary in (2+1*w)?

@79037662 no :D thanks, i didn't see it when i changed it...

Wren, 98 90 bytes
A naive approach. I could have used a lookup table, it golfs out 8 bytes.
Fn.new{|a,b,c,d|" "*3+"&|\\/"[a]+"\n"+" ("[d]+"("+"^.oO"[b]+"v.oO"[c]+"^.oO"[b]+")"*(d+1)}

Try it online!
Wren, 148 144 bytes
An even worse solution, yet I'd like to share it. Does a bunch of replaces on the specified string
Fn.new{|a,b,c,d|"   S\nW(EME)w".replace("S","&|\\/"[a]).replace("W"," ("[d]).replace("w"," )"[d]).replace("E","^.oO"[b]).replace("M","v.oO"[c])}

Try it online!

Charcoal, 28 bytes
↙§&|\/Ｎ§^.oOＮ←§v.oOＮ←←×(⊕Ｎ‖Ｂ

Try it online! Link is to verbose version of code. Taking the inputs in a better order would save 2 bytes. Explanation:
↙§&|\/Ｎ

Input the stem and output the appropriate character, then move to the left eye.
§^.oOＮ

Input the eyes and output the appropriate character.
←§v.oOＮ←

Input the nose and output the appropriate character, then move to the left of the left eye.
←×(⊕Ｎ

Input the width and output the appropriate number of (s.
‖Ｂ

Reflect to complete the pumpkin.

PHP (7.4), 91 bytes
Generates the output string using a template string and strtr array replacement mode.
fn($s,$e,$m,$w)=>strtr('   0
3(121)4',['&|\/'[$s],'^.oO'[$e],'v.oO'[$m],' ('[$w],' )'[$w]])

Try it online!

PHP (7.4), 93 bytes
Generates the output string as it goes on.
fn($s,$e,$m,$w)=>'   '.'&|\/'[$s].'
'.' ('[$w].'('.($y='^.oO'[$e]).'v.oO'[$m]."$y)".' )'[$w];

Try it online!

Red, 135 bytes
func[s e m w][a:["&|\/""^^.oO""v.oO"" ("" )"]rejoin["   "a/1/(s + 1) lf a/4/(t: w + 1) "("a/2/(u: e + 1) a/3/(m + 1) a/2/:u ")"a/5/:t]]

Try it online!

Icon, 121 bytes
procedure f(s,e,m,w)
return map("   s\nw(eme)u","semwu","&|\\/"[s+1]||"^.oO"[e+1]||"v.oO"[m+1]||" ("[w+1]||" )"[w+1])
end

Try it online!


text:
Shooting gallery Puzzle!

Have you been shooting gallery? We are recently.

In our shooting gallery cans and aluminum cans from under various drinks hang and stand. More precisely, they hung and stood.
From our shots, banks dangled from side to side on a rope, were torn off, rang, crumpled. This is not for you to shoot from your fingers.
Each of the bullets either went right through one of the cans, after which the affected can fell to the floor and rolled away so that it was no longer possible to get into it; or didn’t hit any of the cans. In any case, each of the bullets was stuck in the wall behind our target cans.
But that day is past. There was only a wall with bullets stuck in it and a photograph. In an attempt to restore that day and enjoy it again, we collected data on the position of each bullet in the wall, the location of the cans and the order of the shots.

Help determine about each bullet whether it hit one of the cans, and if it hit, then which one.

Input format
The first line contains two integers n and m (1 ≤ m, n ≤ 1000) - the number of cans that were our target on that day, and the number of shots fired that day.
The i-th of the next n lines describes the position of the i-th jar. The position is set by the coordinates of the can’s projection onto the vertical plane. The projection is a rectangle, the sides of which are parallel to the coordinate system applied to this plane. The Y axis of this system is directed vertically upward, and the X axis is horizontally. A rectangle is defined by a pair of points - its left bottom and top right vertices.

It is guaranteed that not a single pair of these rectangles has a single common point.

The i-th of the next m lines describes the position of the i-th bullet in the wall. The bullets are set in the same order in which they left our muzzle. The wall itself is strictly vertical, so we can assume that the position is given by the coordinates of the projection of bullets on a vertical plane. Moreover, the trajectories of the bullets were strictly perpendicular to this plane. The points themselves are defined by a pair of coordinates in the coordinate system already described above.

The distance between the banks and the wall compared to the distance to the shooters is so small that we neglect it.

Output format
In the first and only line print m numbers, the i-th of which says which of the cans the i-th bullet went through, if any. If i didn’t hit any banks, print -1, otherwise print the serial number in the input of the bank, which was struck by the ith bullet.
Sample Input:

4 10
0 0 1 1
2 3 3 8
15 15 20 20
10 12 12 13
2 2
0 -1
23 18
13 12
10 13
16 16
17 17
3 5
3 5
3 3

Sample Output:

-1 -1 -1 -1 4 3 -1 2 -1 -1

Here is a representation of the positions in the above sample - the original locations of the four cans 1 - 4, and the ten bullet locations a - j - note that i is actually in the same location as h ((3,5)) and that a row is shown for y=-1 due to b:
. . . . . . . . . . . . . . . 3 3 3 3 3 3 . . .
. . . . . . . . . . . . . . . 3 3 3 3 3 3 . . .
. . . . . . . . . . . . . . . 3 3 3 3 3 3 . . c
. . . . . . . . . . . . . . . 3 3 g 3 3 3 . . .
. . . . . . . . . . . . . . . 3 f 3 3 3 3 . . .
. . . . . . . . . . . . . . . 3 3 3 3 3 3 . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . e 4 4 . . . . . . . . . . .
. . . . . . . . . . 4 4 4 d . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . 2 2 . . . . . . . . . . . . . . . . . . . .
. . 2 2 . . . . . . . . . . . . . . . . . . . .
. . 2 2 . . . . . . . . . . . . . . . . . . . .
. . 2 h . . . . . . . . . . . . . . . . . . . .
. . 2 2 . . . . . . . . . . . . . . . . . . . .
. . 2 j . . . . . . . . . . . . . . . . . . . .
. . a . . . . . . . . . . . . . . . . . . . . .
1 1 . . . . . . . . . . . . . . . . . . . . . .
1 1 . . . . . . . . . . . . . . . . . . . . . .
b . . . . . . . . . . . . . . . . . . . . . . .

Hence e struck 4, f struck 3, and h struck 2 (while g, i, and j would have struck cans if those cans had not already fallen to the floor):
 a  b  c  d  e  f  g  h  i  j
-1 -1 -1 -1  4  3 -1  2 -1 -1

Welcome to CG&CC! This seems like it could be an interesting challenge, but the specification is a bit difficult to understand, and the input format is overly restrictive, not to mention that there's no objective winning criterion. You could make this [tag:code-golf], and amend the input format to "anything reasonable" (while describing it in terms of lists or arrays, most likely), to fix the last two issues, but while you're busy with that the challenge should probably remain closed.

@CyberDemon I added a visualisation because I think it helps clarify the situation. Please check it both accurately reflects what is going on and is correct. I agree with Unrelated String that the input format should avoid the need for boiler-plate I/O processing (allowing lists in any reasonable format is the norm for a question like this on this site as it allows more languages and keeps the challenge to its core).

Since there is never a can 0 may we use 0 for "missed" instead of -1?

Jelly, (19?) 39 bytes
The entire second line is dealing with the strict I/O spec currently in place, while the 19 byte first line is a dyadic Link performing the core of the challenge. Also if 0 were allowed where -1 is currently required save the o- for -2 bytes.
r/p/ċɗ€ⱮT€Ḣ€ŒQa"$o-
ỴḲ€VḢḢ‘œṖƲŒH€€1¦ç/K

Try it online!


text:
Is this a valid input for this hardware?
The (slightly harder, but still easy) sequel of Generate input for this hardware.
Background
I have a hardware that has a 32-bit input register. The register has the following characteristics:

The 32-bit register consists of eight 4-bit fields.
Each 4-bit field holds a value in signed-magnitude; it can hold an integer between -7 and +7 inclusive, including -0 and +0 (signed zeroes).

For example, the hexadecimal value 0xABCD1234 represents the field values [-2, -3, -4, -5, +1, +2, +3, +4]. In fact, one hex digit represents one 4-bit value with the following mapping:
Hex    |  Input value
---------------------
0 ~ 7  |  +0 ~ +7
8 ~ F  |  -0 ~ -7

In order to correctly operate this hardware, the 8 field values must be strictly increasing from left (most significant) to right (least significant). For signed zeros, -0 is considered to be less than +0.
The following are the examples of valid inputs:
field values for 8 fields        => 32-bit register value
[-7, -6, -5, -4, -3, -2, -1, -0] => 0xFEDCBA98
[+0, +1, +2, +3, +4, +5, +6, +7] => 0x01234567
[-7, -4, -3, -2, -0, +1, +3, +4] => 0xFCBA8134
[-2, -1, -0, +0, +3, +4, +5, +7] => 0xA9803457

The following are the examples of invalid ones:
field values for 8 fields        => 32-bit register value
[+7, +6, +5, +4, +3, +2, +1, +0] => 0x76543210 // not increasing
[-2, -1, -0, -0, +1, +2, +3, +4] => 0xA9881234 // not strictly increasing, due to duplicates
[-3, -2, -1, +0, -0, +1, +2, +3] => 0xBA908123 // +0 is greater than -0

Task
Given the register value, determine if it is a valid input to the hardware.
Input and output
The input (the register value) is an unsigned 32-bit integer. You can take it as an integer, a string, or a list of digits. A string or list of digits can be in base 2, 8, 10 or 16, least-significant-digit-first or most-significant-digit-first, with or without leading zeros or base prefixes.
For example, if an input value is 0x01234567, possible representations in base 16 include "0x01234567", "01234567", "1234567", "76543210" (reversed order of digits), [0, 1, 2, 3, 4, 5, 6, 7], [7, 6, 5, 4, 3, 2, 1, 0].
The output is a boolean, indicating whether the given input is valid or not. You can choose to output either:

Any of the truthy/falsy values as defined by the language of your choice

The actual result values may differ between inputs (e.g. output 1 for a truthy input and 2 for another truthy one).
Swapping truthy and falsy values is not allowed.

Any two distinct constant values for true/false respectively

In this case, the result values should exactly be one of the two constant values.

Scoring
The standard code-golf rules apply. The shortest code in bytes wins.
Test cases
Expected output: Valid
0xFEDCBA98
0xEDCBA980
0x80123456
0x01234567
0xFCB98037
0xEDB12345

Expected output: Invalid
0x76543210
0x1A2B3C4D
0x12345678
0xBA988123
0xBA908123
0x00123456
0xB9882347
0xDC914556

Is the 0x required in the input?

@ValueInk No, it's not required.

In case anyone wants to make us of it, the expression (~n/8&2**32/15)*7^n reverses the hex digits 0-7, putting the digits of a valid input n into "normal" decreasing order in hex.

Python 2, 52 bytes
lambda s:eval("'EDCBA9801234567'.find(%r)<"*8%s+'s')

Try it online!
Takes input as a tuple like ('F', 'E', 'D', 'C', 'B', 'A', '9', '8').
The idea is to produce out and evaluate a long chain of inequalities like:
'EDCBA9801234567'.find('F')<'EDCBA9801234567'.find('E')<'EDCBA9801234567'.find('D')<'EDCBA9801234567'.find('C')<'EDCBA9801234567'.find('B')<'EDCBA9801234567'.find('A')<'EDCBA9801234567'.find('9')<'EDCBA9801234567'.find('8')<s

The s at the end of the chain takes care of the extra trailing < symbol by giving an always-true comparison of "number < string" in Python 2 logic.

Ruby -n, 36 bytes
Outputs 1 if valid, nil if not.
p~/xF?E?D?C?B?A?9?8?#{[*0..7]*??}?$/

Try it online!

Perl 6, 25 24 bytes
{[>] ((8 X>$_)X*7)Z+^$_}

Try it online!
Takes a list of integers.
Explanation
{                      }  # Anonymous block
     (           )Z+^$_   # XOR input values with
      (8 X>$_)X*7         #   7 if value < 8, reversing sort order
                          #   0 otherwise, keeping value unchanged
 [>]  # All values strictly decreasing?

F# (.NET Core), 91 bytes
 [for i:char in n->"EDCBA9801234567".IndexOf(i)]|>List.pairwise|>List.forall(fun(x,y)->x<y)

Try it online!

Jelly, 9 bytes
N>¡€7I>0Ạ

Try it online!
A monadic link taking a list of bass 16 digits and returning 1 for true and 0 for false.
Explanation
  ¡€      | For each digit, if:
 >  7     | - Greater than 7
          | Then:
N         | - Negate
     I    | Increments between each digit
      >0  | Greater than 0
        Ạ | All

PHP (7.4), 54 bytes
fn($a)=>preg_match(_.join('.*',$a)._,FEDCBA9801234567)

Try it online!
Input is array of digits in base 16 (example: ['F','E','D','C','B','A','9','8']);

05AB1E, 17 bytes
Σ•_ćúθœιu0•hSk}ÙQ

Try it online!
Explanation:
Σ             }             # Sort by
             k              # the index of each char of the input in...
 •_ćúθœιu0•hS               # [7...0,9,8,A...F]
               Ù            # remove duplicates
                Q           # and check that it's not changed

05AB1E, 8 bytes
H8(вÆü‹P

Try it online! or validate all test cases.
Input is a list of hex digits. Output is 1 for truthy, 0 for falsy.
H          # convert from hex
 8(в       # convert to base -8
    Æ      # reduce by subtraction
     ü‹    # pairwise less-than
       P   # product

JavaScript (Node.js), 53 bytes
f=([a,...b])=>b<f||g(a)>g(b[0])&f(b)
g=x=>x<8?x-8+g:x

Try it online!
Python 3.8 (pre-release), 44 bytes
lambda s:eval("((t:=0x%c)^-(t>7))<"*8%s+'9')

Try it online!


text:
Translate a simple sentence from Toki Pona
Toki Pona is a linguist's code golf: A minimalist language with a vocabulary of around 120 words. Because of this, it has very few grammatical irregularities found in other languages, making it ideal for a code golf challenge.
Your task is to take the most simple form of a Toki Pona sentence and translate it into English, using the (even more) limited dictionary provided in this question.
The dictionary
While 120 words isn't a lot for a language, it's a lot of bytes. So, for that reason, I'm limiting the input to only contain these 20 words (English translation in brackets, Toki Pona in bold):

Pronouns: mi (I/me), sina (you) and ona (he/she/it/him/her)
Grammatical constructs: li and e
Verbs: jo (to have), moku (to eat), pona (to fix), oko (to see) and wile (to want)
Adjectives: pona (good/simple), ike (bad), wan (one/unique) and mute (many)
Nouns: kili (fruit), oko (eye), jan (person/man/woman), moku (food), ilo (tool) and ijo (thing)

In addition, sentences involving the verb to be are included (expanded on later).
As you can see, simple sentences such as I want food can be made from this list: mi wile e moku. We'll address the exact grammatical construction in the next section. However, note that a single word may be used for multiple different English words (e.g. moku), which is how such a limited vocabulary is possible.
Grammar
All of the sentences you'll be required to handle will have one of the following forms:

pronoun/noun "li" verb

e.g. ona li oko (he sees)

pronoun/noun "li" pronoun/noun

e.g. ona li jan (she is a person)

pronoun/noun "li" noun adjective

e.g. ona li ijo ike (it is a bad thing)

pronoun/noun "li" verb "e" pronoun/noun

e.g. jan li jo e kili (the person has fruit)

pronoun/noun "li" verb "e" noun adjective

e.g. jan li jo e kili pona (the person has good fruit)

We'll call the first pronoun/noun the subject of the sentence and the second the object. Notice that the adjective comes after the noun, not before, and that pronouns cannot be paired with adjectives.
For example, ona li moku e moku (He eats food) is of the fourth form. However, the one exception is that if the subject is mi (I/me) or sina (you), then li is omitted. So mi moku e moku would translate as I eat food.
You'll notice that forms 2 and 3 don't have a verb, but our translated examples do. This is because Toki Pona has no word for to be. While we would say "I am good", Toki Pona speakers would say mi pona instead (omitting the verb). If the subject is not mi or sina, then li is used as it would be usually: kili li moku.
The two constructs li and e are used in the following ways:

If the pronoun preceding is not mi or sina, the verb in the sentence is preceded by li. For example, moku li moku or ona li oko
The object in the sentence is always preceded by e. For example, moku li moku e moku or mi pona e ilo mute.

Notice that Toki Pona doesn't conjugate verbs, nor does it change the word when plural. Due to this, you should assume that all input is in the singular (ijo is translated as thing, not things)
English translation
In comparison, all outputted sentences should be in the forms

pronoun/noun verb
pronoun/noun verb pronoun/noun
pronoun/noun verb adjective pronoun/noun

As each word has multiple translations (ona is he, she or it), we'll use these translations:
mi   (subject)   -> I
mi   (object)    -> me
sina             -> you
ona  (subject)   -> he
ona  (object)    -> him
jo               -> to have
moku (verb)      -> to eat
moku (noun)      -> food
pona (verb)      -> to fix
pona (adjective) -> good
oko  (verb)      -> to see
oko  (noun)      -> eye
wile             -> to want
ike              -> bad
wan              -> one
mute             -> many
kili             -> fruit
jan              -> person
ilo              -> tool
ijo              -> thing

However, because English has plenty of grammatical irregularities, and we have such a small vocabulary list, the English output should be as accurate as possible. Therefore:

Verbs in English are to be conjugated. This means that for all verbs except to be:

The I and you forms are the same as the infinitive (to fix -> I fix, you fix etc.)
The he form (which includes nouns) modifies the infinitive to end with an s. Specfically, the 5 verbs become has, eats, fixes, sees and wants respectively.

For to be, I becomes am, you becomes are and he (including nouns) become is
Nouns are prefixed with a the  (notice the space), unless the adjective after it is wan (one) or mute (many).
Nouns before mute (many) should have a trailing s (yes even fruit and food). So ilo mute becomes many tools

Your task
You are to take in a single sentence of Toki Pona consisting of only words from those 20, and always in one of the forms listed above (including the to be exceptions), and output the English translation. As is standard in Toki Pona, input will always be lowercase.
You may take input where the separator is any consistent non-alphabetic character or sequence of characters, including spaces (i.e. mi@@@e@@@jan is perfectly acceptable), or you may take input as a list of words, if you wish. The input does not have to make sense (e.g. ijo li jo e jan mute), but will always follow the grammatical rules.
Output rules are equally lax - you may output as a list of words, or as a single string with any consistent, non-alphabetical separator. Case is irrelevant.
This is code-golf so the shortest code in bytes wins!
Test cases

mi wile e moku - I want the food
mi moku e moku - I eat the food
mi pona - I fix+
mi jan - I am the person
ona li oko - He sees/He is the eye*
ona li jan - He is the person
ona li ijo ike - He is the bad thing
jan li jo e kili - The person has the fruit
jan li oko e kili pona - The person sees the good fruit
kili li moku - The fruit is the food/The fruit eats*
moku li moku - The food is the food/The food eats*
moku li moku e moku - The food eats the food
ijo li jo e jan mute - The thing has many persons
ilo li pona e ijo - The tool fixes the thing
sina moku e kili mute - You eat many fruits
sina moku e kili ike - You eat the bad fruit
oko li oko e mi - The eye sees me
mi wile e sina - I want you
jan li moku e ona - The person eats him
mi jo e ijo wan - I have one thing
mi jo e ijo mute - I have many things
sina kili - you are the fruit

*: Either translation is acceptable for output, as both are valid translations
+: I am good would be the natural translation, but using pona as an adjective doesn't fix as one of our five forms, so is not a valid translation in this case

Sandbox. I have aimed to be as comprehensive as possible with the test cases, but please comment if you would like any more/a specific test case

"Pronouns: mi (I/me), sina (you) and ona (he/she/it/him/her)" Just hope that this question doesn't fall afoul of the Code of Conduct and get us all suspended.

'I am good' shouldn't be included, because it's a noun/pronoun "li" adjective, the schema is not listed above

@AlexeyBurdin It is, but in this case the li is omitted, as the pronoun is mi. I thought it would be better to have an single exception to the rule, rather than list an additional 5 rules just to cover mi/sina.

I see, I mean other thing: only noun, verb, pronoun is allowed after "li" even if "li" is omitted, but here is adjective after "li" in 'I am good'.

Also why isn't 'you' capitalized in the beginning of a sentence?

@AlexeyBurdin I understand now, yes you are correct, mi pona doesn't fit any form when pona is used as an adjective. I've fixed the test case, and added a note about that specific case. The you wasn't capitalised due to a typo - it has now been fixed.

The list of test cases translated into English read like the lyrics of some '70s Talking Heads song. Same as it ever was!

@Arnauld Added, thanks!

@Arnauld Ah yes, my bad

JavaScript (ES6),  498 ... 447  445 bytes
Outputs in lowercase, except for 'I'.
s=>(s.replace(/\w+/g,w=>(x='2want||2eat/5food||5you|2see/5eye|5thing|1I/4me|5person|8many|8bad|5fruit|1he/4him|5tool||2fix/8good||2have||8one'.split`|`[n=parseInt(w,35)%781%21])&&(x=(g=_=>x.split`/`.find(x=>x[0]>>t&1,t++)||g())(),o[t]=x.slice(1),O[t]=n),o=[t=-1],O=[]))&&([s,v,o,a]=o,[S,V,O,A]=O,g=n=>4241>>n&1?'':'the ')(S)+s+` ${y=144>>S&1,1/V?V^17|y?v:'ha':S^4?S^7?'i':'am':'are'}${y?'':V^15?'s':'es'} `+g(A%10^9&&O)+[a&&a+' ']+[o]+['s'[A^9]]

Try it online!
How?
We first split the input string \$s\$ into words and interpret each of them as an integer in base \$35\$, modulo \$781\$ and modulo \$21\$, which gives a unique ID \$n\$ in \$[0..19]\$. We associate a data string to each ID as follows:
 word   | base 35 to decimal | mod 781 | mod 21 | data
--------+--------------------+---------+--------+--------------
 'mi'   |                788 |       7 |      7 | '1I/4me'
 'sina' |            1223365 |     319 |      4 | '5you'
 'ona'  |              30215 |     537 |     12 | '1he/4him'
 'jo'   |                689 |     689 |     17 | '2have'
 'moku' |             973380 |     254 |      2 | '2eat/5food'
 'pona' |            1102090 |      99 |     15 | '2fix/8good'
 'oko'  |              30124 |     446 |      5 | '2see/5eye'
 'wile' |            1394799 |     714 |      0 | '2want'
 'ike'  |              22764 |     115 |     10 | '8bad'
 'wan'  |              39573 |     523 |     19 | '8one'
 'mute' |             981029 |      93 |      9 | '8many'
 'kili' |             880303 |     116 |     11 | '5fruit'
 'jan'  |              23648 |     218 |      8 | '5person'
 'ilo'  |              22809 |     160 |     13 | '5tool'
 'ijo'  |              22739 |      90 |      6 | '5thing'
 'li'   |                753 |     753 |     18 | ''
 'e'    |                 14 |      14 |     14 | ''

We keep track of the expected type of the next word in the variable \$t\$:

\$t=0\$: subject
\$t=1\$: verb
\$t=2\$: object
\$t=3\$: adjective

The leading digit in front of each translated word is a bitmask describing the types that the word can be associated with. For instance, "5fruit" means that "fruit" may be either the subject (\$2^0=1\$) or the object (\$2^2=4\$) of the sentence.
We use this information to assign the relevant type to each input word. At the end of this process, the array [s,v,o,a] holds the categorized words (subject, verb, object and adjective, respectively) while the array [S,V,O,A] holds the corresponding indices, as described in the penultimate column of the above table.
Using these variables, we can finally apply English rules to translate the sentence.

Python 3, 1902 bytes

import re
p='mi|sina|ona'
v='jo|moku|pona|oko|wile'
a='pona|ike|wan|mute'
n='kili|oko|jan|moku|ilo|ijo'
pn=p+'|'+n
d={'p':p,'v':v,'a':a,'n':n,'pn':pn,'li':'li','e':'e',
   'f':'(?:(?:'+pn+') li|(?:mi|sina))'}
g=['f '+i for i in 'v,pn,n a,v e pn,v e n a'.split(',')]
ma=[re.compile('^%s$'%re.subn(r'\w+',lambda m:'({%s})'%m.group(0),i)[0].format(**d))
    for i in g]
tr0=lambda ph:[m.match(ph) and m.match(ph).groups() for m in ma]
d_={'s':{'mi':'I','sina':'you','ona':'he'},'o':{'mi':'me','sina':'you','ona':'him'},'v':{'jo':'have','moku':'eat','pona':'fix','oko':'see','wile':'want'},'n':{'moku':'food','oko':'eye','kili':'fruit','jan':'person','ilo':'tool','ijo':'thing'},'a':{'pona':'good','ike':'bad','wan':'one','mute':'many'}}
md=lambda x:dict((k,v) for i in x for k,v in d_[i].items())
d_['pn']=md('on')
d_['f']=md('sn')
d_['e']={'e':'_'}
mc=lambda x:lambda t:(lambda d:d[t] if t in d else d['_'])(x)
be=mc({'I':'am','you':'are','_':'is'})
vs=lambda p:list(d_[p].values())
os=vs('o')+vs('s')
tr=lambda x:[(n_,[d_[p][w if n else w.split(' ')[0]] \
              for n,(w,p) in enumerate(zip(i,pt.split(' ')))]) \
             for n_,(i,pt) in enumerate(zip(x,g)) if i]
noun=lambda t:lambda n:n if n in os else t+n
the=noun('the ')
the2=lambda n:'' if n in os else 'the '
v_=mc({'I':'','you':'','_':'s'})
m_=lambda o,a:('s' if (a == 'many') and (o not in os) else '')
tr_={0:lambda n,v:[the(n),
                   v+v_(n)],
     3:lambda s,v,e,o:[the(s),v+v_(s),the(o)],
     1:lambda s,o:[the(s),be(s),the(o)],
     2:lambda s,o,a:[the(s),be(s),the2(o)+a,o+m_(o,a)],
     4:lambda s,v,e,o,a:[the(s),v+v_(s),the2(o)+a,o+m_(o,a)],
     }
from functools import reduce
f_={'haves':'has','fixs':'fixes','the one':'one','the many':'many'}
fx=lambda s:reduce(lambda x,y:x.replace(y[0],y[1]),f_.items(),s)
c=lambda s:s[0].upper()+s[1:]
r=lambda s:[(n,c(fx(' '.join(tr_[n](*a))))) for n,a in tr(tr0(s))]

Try it online!
The function r does the thing.
The testing:

s=r'''mi wile e moku - I want the food
mi moku e moku - I eat the food
mi pona - I am good/I fix*
mi jan - I am the person
ona li oko - He sees/He is the eye*
ona li jan - He is the person
ona li ijo ike - He is the bad thing
jan li jo e kili - The person has the fruit
jan li oko e kili pona - The person sees the good fruit
kili li moku - The fruit is the food/The fruit eats*
moku li moku - The food is the food/The food eats*
moku li moku e moku - The food eats the food
ijo li jo e jan mute - The thing has many persons
ilo li pona e ijo - The tool fixes the thing
sina moku e kili mute - you eat many fruits
sina moku e kili ike - you eat the bad fruit
oko li oko e mi - The eye sees me
mi wile e sina - I want you
jan li moku e ona - The person eats him
mi jo e ijo wan - I have one thing
mi jo e ijo mute - I have many things'''.split('\n')
print('\n'.join(str((r(j.split(' - ')[0]),
                     j.split(' - ')[1].rstrip('*').split('/'))) \
                for j in s))

The test output:

([(3, 'I want the food')], ['I want the food'])
([(3, 'I eat the food')], ['I eat the food'])
([(0, 'I fix')], ['I am good', 'I fix'])
([(1, 'I am the person')], ['I am the person'])
([(0, 'He sees'), (1, 'He is the eye')], ['He sees', 'He is the eye'])
([(1, 'He is the person')], ['He is the person'])
([(2, 'He is the bad thing')], ['He is the bad thing'])
([(3, 'The person has the fruit')], ['The person has the fruit'])
([(4, 'The person sees the good fruit')], ['The person sees the good fruit'])
([(0, 'The fruit eats'), (1, 'The fruit is the food')], ['The fruit is the food', 'The fruit eats'])
([(0, 'The food eats'), (1, 'The food is the food')], ['The food is the food', 'The food eats'])
([(3, 'The food eats the food')], ['The food eats the food'])
([(4, 'The thing has many persons')], ['The thing has many persons'])
([(3, 'The tool fixes the thing')], ['The tool fixes the thing'])
([(4, 'You eat many fruits')], ['you eat many fruits'])
([(4, 'You eat the bad fruit')], ['you eat the bad fruit'])
([(3, 'The eye sees me')], ['The eye sees me'])
([(3, 'I want you')], ['I want you'])
([(3, 'The person eats him')], ['The person eats him'])
([(4, 'I have one thing')], ['I have one thing'])
([(4, 'I have many things')], ['I have many things'])

The raw thing:

import re
p='mi|sina|ona'
v='jo|moku|pona|oko|wile'
a='pona|ike|wan|mute'
n='kili|oko|jan|moku|ilo|ijo'
pn=p+'|'+n
d={'p':p,'v':v,'a':a,'n':n,'pn':pn,'li':'li','e':'e',
   'f':'(?:(?:'+pn+') li|(?:mi|sina))'}
g=['f '+i for i in 'v,pn,n a,v e pn,v e n a'.split(',')]
ma=[re.compile('^%s$'%re.subn(r'\w+',lambda m:'({%s})'%m.group(0),i)[0].format(**d))
    for i in g]
s=r'''mi wile e moku - I want the food
mi moku e moku - I eat the food
mi pona - I am good/I fix*
mi jan - I am the person
ona li oko - He sees/He is the eye*
ona li jan - He is the person
ona li ijo ike - He is the bad thing
jan li jo e kili - The person has the fruit
jan li oko e kili pona - The person sees the good fruit
kili li moku - The fruit is the food/The fruit eats*
moku li moku - The food is the food/The food eats*
moku li moku e moku - The food eats the food
ijo li jo e jan mute - The thing has many persons
ilo li pona e ijo - The tool fixes the thing
sina moku e kili mute - you eat many fruits
sina moku e kili ike - you eat the bad fruit
oko li oko e mi - The eye sees me
mi wile e sina - I want you
jan li moku e ona - The person eats him
mi jo e ijo wan - I have one thing
mi jo e ijo mute - I have many things'''.split('\n')
x=[(lambda ph:[m.match(ph) and m.match(ph).groups() for m in ma])\
   (i.split(' - ')[0]) for i in s]
y=r'''mi   (subject)   -> I
mi   (object)    -> me
sina (subject)            -> you
sina (object)            -> you
ona  (subject)   -> he
ona  (object)    -> him
jo   (verb)            -> to have
moku (verb)      -> to eat
moku (noun)      -> food
pona (verb)      -> to fix
pona (adjective) -> good
oko  (verb)      -> to see
oko  (noun)      -> eye
wile (verb)            -> to want
ike  (adjective)            -> bad
wan  (adjective)            -> one
mute (adjective)            -> many
kili (noun)            -> fruit
jan  (noun)            -> person
ilo  (noun)            -> tool
ijo  (noun)            -> thing'''
from collections import defaultdict
d_=defaultdict(dict)
for w,p,t in re.findall(r'(\w+)\s*\((\w+)\)\s*\-\>\s*(?:to )?(\w+)',y):
    d_[p[0]][w]=t
md=lambda x:dict((k,v) for i in x for k,v in d_[i].items())
d_['pn']=md('on')
d_['f']=md('sn')
d_['e']={'e':'_'}
#print(d_)
mc=lambda x:lambda t:(lambda d:d[t] if t in d else d['_'])(x)
be=mc({'I':'am','you':'are','_':'is'})
hv=mc({'I':'have','you':'have','_':'has'})
vs=lambda p:list(d_[p].values())
tr=lambda x:[(n_,[d_[p][w if n else w.split(' ')[0]] \
              for n,(w,p) in enumerate(zip(i,pt.split(' ')))]) \
             for n_,(i,pt) in enumerate(zip(x,g)) if i]
#print('\n'.join(str((tr(i),j.split(' - ')[1].rstrip('*').split('/'))) \
#                for i,j in zip(x,s)))
noun=lambda t:lambda n:n if n in vs('o')+vs('s') else t+n
the=noun('the ')
the2=lambda n:'' if n in vs('o')+vs('s') else 'the '
v_=mc({'I':'','you':'','_':'s'})
a_=lambda s:('the ' if s not in vs('p') else '')
m_=lambda o,a:('s' if (a == 'many') and (o not in vs('o')+vs('s')) else '')
tr_={0:lambda n,v:[the(n),
                   v+v_(n)],
     3:lambda s,v,e,o:[the(s),v+v_(s),the(o)],
     1:lambda s,o:[the(s),be(s),the(o)],
     2:lambda s,o,a:[the(s),be(s),the2(o)+a,o+m_(o,a)],
     4:lambda s,v,e,o,a:[the(s),v+v_(s),the2(o)+a,o+m_(o,a)],
     }
from functools import reduce
f_={'haves':'has','fixs':'fixes','the one':'one','the many':'many'}
fx=lambda s:reduce(lambda x,y:x.replace(y[0],y[1]),f_.items(),s)
c=lambda s:s[0].upper()+s[1:]
print('\n'.join(str(([(n,c(fx(' '.join(tr_[n](*a))))) for n,a in tr(i)],
                     j.split(' - ')[1].rstrip('*').split('/'))) \
                for i,j in zip(x,s)))
#print('\n'.join(map(str,x)))

You can run it to see it passes all the cases)

I see I can squeeze out 50-100 bytes but it doesn't matter much for 1.9k )

This is very impressive! However, why is the output for jan li oko e kili pona [(4, 'The person sees the good fruit')]? What's with the additional wrapping/array/number?

I've edited your answer slightly to include a link to a testing site. In addition, I've managed to golf -450 bytes with some very weird tricks, including fixing the output format

Awesome. I thought of ~300 bytes including a if b else c to [a,c][b] and optimizing functions. Very impressive.

Jelly, 257 249 bytes
OP€%59µ“:¤¥“ ı“¦1"ø“/“2¿“#“,3‘œiⱮ¹Ƈ’S,@ɗ>5Ḣ$¡"J1,3yƊ$ḢW;1,6y$1¦€ƲḢ,2,3;Ʋ2,1œị=3Ʋ¡+2¦=2Ḣ$¡€58,3iⱮ×7ḢƲḣ;Ṛḣ¥ɗL=4Ɗ¡2+2¦e€3,4Ḣ$¡€1,3¦7œị“¢ṇḃ#ṅ³©½øỴ£⁺Ṭḥ*4=LƤ`:[?SœGʠṂ4£¤ɦ5Ẉḃ⁵ƓOqȤ2MœṁṾġqÐU¤¶ṀẆ¶`ƝUḋ#ḳ#Ạ4Ẏ[`-ckṫ©4%ṙẎọkɲẠ¶{t}6ọ6Ṇ»ỴḲ€“the ”;Ɱ;@Ɗ€3,4¦¤K;11e”sxƲ

Try it online!
A monadic link taking a list of words and returning a string. I’m sure this can be better golfed, but I was just pleased to have something that worked despite the various complexities of the English language!
Explanation
Stage 1
Convert to initial pairs of integers
Note the first of each pair is initially 1 for pronouns, 2 for verbs, 3 for nouns, 4 for adjectives, 5 for quantifiers, 6 for verb/adjective and 7 for verb/noun
O                   | Convert to Unicode codepoints
 P€                 | Product of each word
   %59              | Mod 59
      µ             | Start a new monadic chain
       “:...3‘œiⱮ   | Multidimensional index of this in [[58, 3, 4], [32, 25], [5, 49, 34, 29], 47, [50, 11], 35, [44, 51]]
                 ¹Ƈ | Filter ones that weren’t found (li and e)

Stage 2
Determine meaning for words with two possible meanings; works because nouns can only appear in positions 1 and 3, verbs only in position 2 and adjectives in position 4
                 $ | Following as a monad:
          "     Ɗ  | - Map a link using the following as a monad as the right argument zipped with each element of the input to stage 2 as the left
           J       |   - Index along list
            1,3y   |   - Substitute 1s for 3s (words in the first position
        $¡         | - If:
     >5            |   - Greater than 5
       Ḣ           |   - Head (i.e. if first number is >5)
                   | - Then:
’                  |   - Increment both items in the pair by 1
 S                 |   - Sum
  ,@               |   - Pair the right argument with this

Stage 3
Change pronouns appearing after position 1 to have 6 as their first integer (so that object versions can be used)
            Ʋ | Following as a monad:
Ḣ             | - Head
 W            | - Wrap in a list
  ;           | - Concatenate to:
   1,6y$1¦€   |   - The other list members at input to stage 3, with 1 replaced by 6

Stage 4
Insert ‘to be’ if there is no verb
              Ɗ¡ | If:
       2,1œị     | - the word type of the second word
            =3   | - is equal to 3 (noun)
      Ʋ          | Then following as a monad:
Ḣ                | - Head
 ,2,3            | - Pair with [2,3] (verb to be)
     ;           | - Concatenate to rest of list

Stage 5
If first word is ‘I’ or ‘you’, add 7 or 14 respectively to the verb number
      $¡€           | For each word, if:
   =2               | - Equals 2
     Ḣ              | - Head (i.e. if word is a noun)
+2¦               Ʋ | Add to the second item (word number) the following as a monad:
         58,3iⱮ     | - Index of mod 59 words (from stage 1) within 58 (I), 3 (you)
               ×7   | - Multiply by 7
                 Ḣ  | - Head (i.e. 7 if first word is ‘I’ and 14 if first word is ‘you’.

Stage 6
Swap noun and adjective or quantifier around if present
         Ɗ¡  | If (as a monad):
      L      | - Length
       =4    | - Equals 4
     ɗ     2 | Then (as a dyad), using 2 as the right argument:
ḣ            | - First 2 words
 ;  ¥        | - Concatenated to following as a dyad:
  Ṛ          |   - Reverse
   ḣ         |   - First two words (i.e. last 2 words in reverse order)

Stage 7
Use version of nouns and adjectives with preceding ‘the’ if they appear in the third or first position
           €1,3¦  | For each of first and third words
         $¡       | - If (as a monad):
   e€3,4          |   - Is one of 3 or 4
        Ḣ         |   - Head (i.e. if word type is noun or adjective)
                  | - Then:
+2¦             7 |   - Add 7 to the second item (i.e. word number)

Stage 8
Index into word list
œị                          ¤ | Multidimensional index into following as a nilad
  “¢...Ṇ»                     | - “I you he/wants has is  fixes eats sees want have am  fix eat see want have are  fix eat see/fruit person tool thing  food eye/good bad/one many/me you him” where / indicates newline
         Ỵ                    | - Split at newlines
          Ḳ€                  | - Split each at spaces
                      Ɗ€3,4¦  | - For each of the third and fourth lists of words, do the following as a monad:
            “the ”;Ɱ          |   - Concatenate “the “ to each
                    ;@        |   - Concatenate to end of list

Stage 9
Add “s” to end if many is used
K         | Join with spaces
 ;      Ʋ | Concatenate to the following as a monad (applied to the mod 59 words from stage 1)
  11e     | - Contains 11 (many)
     ”sx  | - that many “s”


text:
Interpret numbers very literally
To interpret a positive integer very literally, write it in English words (without "and"), replace hyphens with spaces, replace each resulting word with its number value, and concatenate the results into a single number.
To write a positive integer more than 99 but less than 1000 in English words, prefix its last two digits written in English with [first digit in English]hundred  with a trailing space.
To write a positive integer more than 999 but less than 1 million in English words, use the following syntax: [part before the last 3 digits in English]thousand[last 3 digits in English], all separated by spaces.
The task is to input a positive integer (less than 1 million) and output it, interpreted very literally.
Examples
1 -> 1                       (one)
10 -> 10                     (ten)
16 -> 16                     (sixteen)
23 -> 203                    (twenty three)
111 -> 110011                (one hundred eleven)
123 -> 1100203               (one hundred twenty three)
1234 -> 110002100304         (one thousand two hundred thirty four)
12345 -> 1210003100405       (twelve thousand three hundred forty five)
123456 -> 110020310004100506 (one hundred twenty three thousand four hundred fifty six)
1056 -> 11000506             (one thousand fifty six)
101101 -> 11001100011001     (one hundred one thousand one hundred one)
110110 -> 1100101000110010   (one hundred ten thousand one hundred ten)

Feel free to add more test cases if necessary.
This is tagged code-golf, so the shortest code wins.

Link to deleted sandbox post

May I suggest a couple test cases where there are 0s in the middle of the number? e.g. 1056 -> 11000506

Also, what output should be given for 100? I would assume it should be 1100 (one hundred)?

@BusinessCat That's correct. I will add some more test cases later.

05AB1E, 26 23 21 bytes
₄вεтвεSÐP@θ1Ký0Û]тý₄ý

Port of @Neil's Charcoal answer, so make sure to upvote him as well.
-5 bytes thanks to @Grimy.
Try it online or verify all test cases.
Explanation:
₄в                # Convert the (implicit) input-integer to base-1000 as list
                  #  i.e. 119100 → [119,100]
                  #  i.e. 23 → [23]
  ε               # Map each value to:
   тв             #  Convert the value to base-100 as list
                  #   i.e. [119,100] → [[1,19],[1,0]]
                  #   i.e. [23] → [[23]]
     ε            #  Map each value `y` to:
      S           #   Convert the current value to a list of digits
                  #    i.e. [[1,19],[1,0]] → [[[1],[1,9]],[[1],[0]]]
                  #    i.e. [[23]] → [[[2,3]]]
       Ð          #   Triplicate this list
        P         #   Take the product of each inner list of digits
                  #    i.e. [[[1],[1,9]],[[1],[0]]] → [[[1],[9]],[[1],[0]]
                  #    i.e. [[[2,3]]] → [[6]]
         @        #   Check if it's larger than or equal to each digit
                  #    i.e. [[[1],[1,9]],[[1],[0]]] and [[[1],[9]],[[1],[0]]
                  #     → [[[1],[1,1]],[[1],[1]]]
                  #    i.e. [[[2,3]]] and [[6]] → [[[0,0]]]
          θ       #   Keep only the last check of each
                  #    i.e. [[[1],[1,1]],[[1],[1]]] → [[[1],[1]],[[1],[1]]]
                  #    i.e. [[[0]]]
           1K     #   Remove all 1s from each 'string'
                  #    i.e. [[[1],[1]],[[1],[1]]] → [[[""],[""]],[[""],[""]]]
                  #    i.e. [[["0"]]]
             ý    #   Join the list of digits by this string
                  #    i.e. [[[1],[1,9]],[[1],[0]]] and [["",""],["",""]]→ [[1,19],[1,0]]
                  #    i.e. [[[2,3]]] and [["0"]] → [[203]]
      0Û          #   Remove any trailing 0s
                  #    i.e. [[1,19],[1,0]] → [[1,19],[1,""]]
                  #    i.e. [[203]] → [[203]]
  ]               # Close both maps
   тý             # Join the inner lists by "100"
                  #  i.e. [[1,19],[1,""]] → [110019,1100]
                  #  i.e. [[203]] → [203]
     ₄ý           # And then those strings by "1000"
                  #  i.e. [110019,1100] → 11001910001100
                  #  i.e. [203] → 203
                  # (after which the result is output implicitly)

yĀ× to 0Û, y20›yθĀ* to ySPyθ›. TIO.

@Grimmy Thanks. That ySPyθ› is smart! :D Too bad the duplicated yS cannot be golfed. I saw a few alternatives, but all the same byte-count. Unless you know an alternative for the 0#× for "0" if truthy; "" if falsey?

Actually the duplicated yS can be golfed: 22. EDIT: 21.

@Grimmy Ah, that 21 is smart. First doing the >= check, and only then getting the last value. And also that 1K for "0" or "". Nice one!

@Grimmy I like that replacement of ">20 and >0 (mod 10)" with "digitial product exceeds last digit" - it saved me two bytes on my Charcoal answer too, thanks!

Python 2, 76 bytes
f=lambda n,k=1000:n>19and(f(n/k,k/10)+`k-k%4*5`)*(n>=k)+f(n%k,k/10)or`n`[:n]

Try it online!
Test suite from Chas Brown.
A fully recursive solution that splits on place values k=1000, k=100, and k=10. The separator for the place values is computed as k-k%4*5, which maps
1000 -> 1000
100  -> 100
10   -> 0

By stopping when n<=19, we avoid one-word numbers in the teens being split up.

Gaia, 44 43 bytes
:(!>
ℍZ:₸Z¤1>∧'0×¤ṙ$×:dẏ×,↑ℍṙ×
@3eZ,↑¦↓3eṙ×

Longer than my original answer, but it works now.
fixed my code again but now it's twice as sad
Try it online!
@3eZ,↑¦↓3eṙ×  Main function.
@3eZ          Input divmod 1000, pushes input div 1000 then input mod 1000
    ,         Pair those two value into a list
     ↑¦       Run the upper function on both
       ↓      Call the function below (loops to top function)
        3eṙ   The string "1000"
           ×  Join the list with "1000"

ℍZ:₸Z¤1>∧'0×¤ṙ$×:dẏ×,↑ℍṙ×  Helper function. Called with 1 argument.
ℍZ                          Divmod with 100
  :₸Z                       Copy the mod part and divmod with 10
                            Stack is: [100s digit, arg mod 100, 10s digit, 1s digit]
     ¤1>                    Bring 10s digit to the top and check if it's greater than 1
        ∧                   Logical AND with 1s digit. (results in 0 or 1)
         '0×                Multiply the character 0 by that result
            ¤               Bring 'arg mod 100' to the top
             ṙ$             Get its string representation and split it into characters
                            (simply doing digit list doesn't work in the case it's 0)
               ×            Join this with the multiplied '0' string
                :d          Copy and parse as a number
                  ẏ         Is it positive? (0 or 1)
                   ×        Multiply the string of the number by that result.
                    ,       Pair: gives the list [100s digit, string from above]
                     ↑      Call the function above
                      >     Remove the first ^ elements from the pair
                       ℍṙ×  Join the resulting list with the string "100"

:(!>  Helper function 2. In this program it is only called with a list.
:(    Copy and get the first element.
  !   Boolean negate (0 or 1)
   >  Remove that many characters from the start of the list

Python 3+inflect, 193 bytes
import inflect,re
exec("for i in re.sub('(and)|\W',' ',%sinput())).split():\n for j in range(0,6**8):\n  if i in %sj):\n   print(j,end='')\n   break"%(('inflect.engine().number_to_words(',)*2))

Try it online!
Very naive solution which uses Python's inflect library. Here is the unfurled code:
import inflect,re
for i in re.sub('(and)|\W+',' ',inflect.engine().number_to_words(input())).split():
 for j in range(0,6**8):
  if i in inflect.engine().number_to_words(j):
   print(j,end='')
   break

Replace 6**8 with 9**9 and this should work in theory for all inputs under a billion, but would take ages.

So you're using a 3rd party library that is exactly to convert numbers to words... So why don't you create a library that completes the exercise and just use that. I bet you can do it in less than 10 bytes

@JBernardo For the same reason you can't just write a language that solves the question in 0 bytes, but my mistake was not putting the library in the header. https://codegolf.meta.stackexchange.com/questions/7243/can-i-write-a-golfing-library

Or am I wrong about that?

PHP, 137 136 143 bytes
function f($n){return$n>99?$n>999?f(substr($n,0,-3)).(1e3).f(substr($n,-3)):$n[0].'100'.f($n[1].$n[2]):($n>20&&$n%10?(0^$n/10).'0'.$n[1]:+$n);}

Try it online!

Also doesn't work for the 1056 case

@JBernardo thanks, fixed.

Charcoal, 34 32 31 29 bytes
⪫Ｅ↨Ｎφ⪫Ｅ↨ι¹⁰⁰⪫↨λχ…0›Πλ﹪λχ100Ｉφ

Try it online! Link is to verbose version of code. Edit: Saved 2 bytes thanks to @Grimmy. Saved a further byte by finding a better way to choose between 0 or the empty string from a boolean. Saved a further 2 bytes because Base(l, 10) conveniently returns an empty array when l is zero. Explanation:
   Ｎ                            Input number
  ↨ φ                           Convert to base 1000 as an array
 Ｅ                              Map over elements
        ι                       Current element
       ↨ ¹⁰⁰                    Convert to base 100 as an array
      Ｅ                         Map over elements
              λ                 Current element
             ↨ χ                Convert to base 10 as an array
            ⪫                   Join with
                 0              Literal `0`
                …               Truncated to length
                    λ           Current element
                   Π            Digital product
                  ›             Is greater than
                      λ         Current element
                     ﹪          Modulo
                       χ        Predefined variable 10
     ⪫                          Join with
                        100     Literal string `100`
⪫                               Join with
                            φ   Predefined variable 1000
                           Ｉ    Cast to string

Example: 67890 ⇒ [67, 890] ⇒ [[67], [8, 90]] ⇒ [[607], [8, 90]] ⇒ [607, 810090] ⇒ 6071000810090.

JavaScript, 69 bytes
Recursively splits and joins based on place values stored in k. Inspired by xnor's Python answer.
f=(n,k=1e3)=>n<20?+n||'':(n<k?'':f(n/k|0,k/10)+[k-10&&k])+f(n%k,k/10)

Try it online!

Python 3, 110 115 bytes
def F(n,o=""):
 for i in 1000,100:
  if n>=i:o+=F(n//i)+str(i);n%=i
 return o+'0'[:0<n%10<=n>19].join(str(n))*(n>0)

Try it online!
Pretty simple. Hundreds and thousands are handled recursively.
+5 bytes but fixed a bug with F(100) thanks to @ChasBrown.

F(100) gives wrong result.

107 bytes, also fixes the F(100) issue.

Which python is it? QtPython 3.6.6 on Android gives me just the digit representation not words. F(55) -> '505'

@ChasBrown Unfortunately that fails on F(20).

@79037662 : Quite right! 115 bytes .  Also was a bug in my answer as well.

JavaScript, 95 93 92 bytes
f=n=>n>999?f(n/1e3|0)+[1e3]+f(n%1e3):n>99?(n/100|0)+'100'+f(n%100):n>20&&(x=n%10)?n-x+''+x:n

Try it online!

-2 bytes (@Shaggy): store n%10 in a variable
-1 byte (@Arnauld): replace '1000' with [1e3]

93 bytes

'1000' can be turned into [1e3].

Python 2, 106 105 100 107 bytes
f=lambda n:n/T and f(n/T)+`T`+f(n%T)or(n>=H)*`n/H*T+H`+'0'[:n%10>0<n%H>19].join(`n%H`)*(n%H>0)
H=100;T=1000

Try it online!
Saved 5 bytes adapting the .join approach of randomdude999's answer; lost 7 bytes fixing a bug :).


text:
Reach the number in minimum steps
In this challenge, you are given a number x. You have to find the minimum number of steps required to reach x from 1. At a particular point, you have two choices:
1) Increment the number by 1.
2) Reverse the integer (remove leading zeros after reversing)
Input: n=42
Output: 1>2>3>4>5>6>7>8>9>10>11>12>13>14>41>42 **(15 steps)**

The minimum steps to reach 42 from 1 is 15. This can be achieved if we increment numbers by 1 from 1 to 14 (13 steps). After reaching 14 we can reverse the number which will give us 41 (1 step). From 41 we can increment number by 1 to reach 42(1 step). Hence the total number is 15 steps, which is then the minimum.
Note that if we reverse the number after reaching 12 or 13, we will not get the minimum steps.
1>2>3>4>5>6>7>8>9>10>11>12>21>22>23>32>33>34>35>36>37>38>39>40>41>42 (25 steps)
Input: n=16
Output: 1>2>3>4>5>6>7>8>9>10>11>12>13>14>15>16 **(15 steps)**

In this case we have to increment the numbers until we get 16, which will give us a minimum of 15 steps.
Note:  Starting from 0 is also allowed, which will increase all output by 1.

Nice challenge but it needs test cases and a clearly defined rules.

What's reverse(reverse(10)) and reverse(2)?

@girobuz reverse(10) will be 1 (After removing leading zeros) - I had missed it earlier. have added it in the second step. so reverse(reverse(10)) will be reverse(1) which is 1. reverse(2) -> 2

Your counter-example (25 steps to reach 42) could be reduced to 1>2>3>4>5>6>7>8>9>10>11>12>21>22>23>24>42 (16 steps), which is still more than the correct solution (15 steps), but... less worse :-)

Can any one prove that: $ reversed(n) > n \implies stepTo(reversed(n)) \ge stepTo(n) $? I saw many answers assumed this.

May we use 0-indexing?

yes, we can use 0 based-indexing. in that case, the answer will increment by one

Haskell, 82 73 bytes
r=read.reverse.show
f 1=0
f a=1+(minimum$f(a-1):[f$r a|r a<a,mod a 10>0])

Try it online!
Simplest recursion method.
-9 bytes thanks to Christian Sievers

Nice solution. But what if we have x = 10**10. is there any way to optimize it

@veersingh I'm sure there is, but this is code golf so there is no reason to do so :)

73 bytes by improving the last line

@ChristianSievers Thanks for the help.

C++, 140 159 147 145 bytes
Edit: new solution without standard library, using a recursive function and pointer magic (constant 20 experimentally determined and not the same on other compilers)
Edit 2: -2 bytes thanks to ceilingcat
int*s,S,*G,x;int F(int Z,int*p=&x){int W=1,a=(*p)++,r=0;for(;r=r*10+a%10,a/=10;);G?W=r,p<=G?G=&W,S++,p=s:0:p=s=G=&W;return*p-Z&&W-Z?F(Z,p-20):S;}

Try it online!
int *s,S,*G,x;
int F(int Z,int*p=&x)
{
    int W=1,a=(*p)++,r=0;
    for(;r=r*10+a%10,a/=10;);
    G?W=r,p<=G?G=&W,S++,p=s:0:p=s=G=&W;
    return *p-Z&&W-Z?F(Z,p-20):S;
}

Old solution with standard library (159 bytes)
#include<set>
int Z(int N){int C=0,r,a;std::set T{1},S{1};for(;;++C,T=S,S={})for(int i:T){if(i==N)return C;for(r=0,a=i;r=r*10+a%10,a/=10;);S.insert({i+1,r});}}

Try it online!
int Z(int N)
{
    int C = 0, r, a;
    set T{ 1 }, S{ 1 };
    for (;; ++C, T = S, S = {})
        for (int i : T)
        {
            if (i == N)
                return C;
            for (r = 0, a = i; r = r * 10 + a % 10, a /= 10;);
            S.insert({ i + 1,r });
        }
}

Edit: add #include to byte count

Welcome to Code Golf.SE! We generally require library #includes to be counted towards your byte count, so this would be 160 bytes

Suggest p=G?W=r,p<=G?G=&W,S++,s:p:s=G=&W instead of G?W=r,p<=G?G=&W,S++,p=s:0:p=s=G=&W

Jelly, 16 bytes
Recursion might well end up being less bytes.
ṚḌ;‘))Fṭ
1Ç¡ċ€ċ0

A monadic Link accepting a positive integer which yields a non-negative integer
Try it online!
Or try a faster, 17 byte version
How?
ṚḌ;‘))Fṭ - Helper Link: next(achievable lists)
     )   - for each (list so far):
    )    -   for each (value, V, in that list):
Ṛ        -     reverse the digits of V
 Ḍ       -     convert that to an integer
   ‘     -     increment V
  ;      -     concatenate these results
      F  - flatten the results
         -   * with a Q here we de-duplicate these results making things faster
       ṭ - tack that to the input achievable lists

1Ç¡ċ€ċ0 - Main Link: positive integer, N
1       - literal one
  ¡     - repeat this (implicit N) times:
 Ç      -   the last Link as a monad - N.B. 1 works just as well as the list of lists [[1]]
   ċ€   - for each count the occurrences of (implicit N)
     ċ0 - count the zeros (i.e. the number of lists that did not yet contain N)

05AB1E (legacy), 15 13 bytes
1¸[ÐIå#ís>«}N

-1 byte and much faster thanks to @Jitse, which also opened an opportunity for a second -1 byte.
Try it online or verify the first 100 test cases (with added Ù -uniquify- to increase the speed).
Explanation:
1¸        # Push 1 and wrap it into a list: [1]
  [       # Start an infinite loop:
   Ð      #  Triplicate the list
    Iå    #  If the input-integer is in this list:
      #   #   Stop the infinite loop
    í     #  Reverse each integer in the copy-list
     s    #  Swap to get the initial list again which we triplicated
      >   #  Increase each value by 1
       «  #  And also merge it
  }N      # After the infinite loop: push the loop-index
          # (which is output implicitly as result)

Uses the legacy version of 05AB1E, because using the index N outside a loop like that doesn't work in the new version.

14 bytes: You don't need to do the first merge, since the previous values don't matter. This is much faster, too. Also, OP mentioned that 0-indexing is also fine. Not sure if that could save more.

@Jitse Ah, of course. Thanks, that's indeed a lot faster! And it also opened up a second -1, since I no longer need the list four times but three instead, so the ©/® can be replaced with a swap. PS: 0-based indexing won't save bytes unfortunately. Creating a list with just 0 or just 1 is both 2 bytes (creating an empty list or list with an empty string is possible in 1 byte).

Nice find! I was also playing with that a bit, but I didn't know enough 05AB1E to get it working. I think I was confused by the fact that checking if a value is in the list also replaces the top of the stack.

Perl 6, 26 25 bytes
{+(1,{1+$_|+.flip}...$_)}

Try it online!
Does pretty much as the question asks. Starting from 1, either increment the Junction of values or flip it, repeating this until we find the one value we're looking for. Then return the length of the sequence. This is zero-indexed (as in, 1 returns 1)
This times out for testcases with a larger number of steps, since for every step we're doubling the size of the Junction by running two operations over the entire thing.

C++ Recursive Solution:
int reverse(int n)//reverses the number
{
    int rev=0;
    while(n>0)
    {
        rev=rev*10+n%10;
        n/=10;
    }

    return rev;
}

int sol(int n, int x)
{
    if(n==x)// base case
        return 0;

    if(n>x)// base case
        return 1e5;

    if(reverse(n)<=n)// otherwise, recursion will happen infinitely
        return 1+sol(n+1,x);

    return 1+min(sol(n+1,x),sol(reverse(n),x));

}

int main()
{
   cout<<sol(1,42);
   return 0;
}

C++ Dynamic Programming Solution:
int dp[1000];
int reverse(int n)//reverses the number
{
    int rev=0;
    while(n>0)
    {
        rev=rev*10+n%10;
        n/=10;
    }

    return rev;
}

int sol(int n, int x)
{
    if(n==x)// base case
        return 0;

    if(n>x)// base case
        return 1e5;

    if(dp[n]!=-1)
        return dp[n];

    if(reverse(n)<=n)// otherwise, recursion will happen infinitely
        return dp[n]=1+sol(n+1,x);

    return dp[n]=1+min(sol(n+1,x),sol(reverse(n),x));

}

int main()
{

    fill_n(dp,1000,-1);

    sol(1,42);
    cout<<dp[1];
    return 0;
}

I think there's a way to save a few bytes here, not sure though

Try it online! , hello! this is [code-golf] so answers should be shortened as possible, I also suggest to use Tio, here is your solution golfed a bit

What is fill_n? It seems to be undefined function.

Where's the score? Surely you can golf this somewhat by removing whitespace and shortening variable names

Ruby, 67 bytes
Starts from 0. I noticed GB's Ruby solution after I finished my own, but the approaches used are drastically different (recursive vs. non-recursive) so I decided to post anyways.
f=->n{r=n.digits.join.to_i;n<9?n:[f[n-1],n>r&&n%10>0?f[r]:n].min+1}

Try it online!

Charcoal, 47 bytes
Ｎθ≔⁰ηＷ⊖θ«Ｆ∧⁻⊖θＸχ⊖Ｌθ¬﹪⊖θＸχ÷⊕Ｌθ²«≦⮌θ≦⊕η»≦⊖θ≦⊕η»Ｉη

Try it online! Link is to verbose version of code. Explanation:
Ｎθ

Input the target.
≔⁰η

Set the number of steps to zero.
Ｗ⊖θ«

Repeat until the target becomes 1.
Ｆ∧⁻⊖θＸχ⊖Ｌθ¬﹪⊖θＸχ÷⊕Ｌθ²

Look to see if the target is of the form xxx0001 or xxxx0001, but not 10..01. (This expression fails for 1, but fortunately the loop stops before we get here.)
«≦⮌θ≦⊕η»

If so then reverse the target and increment the number of steps.
≦⊖θ≦⊕η

Decrement the target and increment the number of steps.
»Ｉη

Output the number of steps once the target has been reduced to 1.

... why the downvote?

Python 3, 78 bytes
f=lambda n,s={1}:n in s or-~f(n,{int(str(i)[::-1])for i in s}|{i+1for i in s})

Try it online!
Uses 0-indexing. Note that in Python True == 1.

Ruby, 72 bytes
->i{*w=0;(0..i).find{[]==[i]-w=w.flat_map{|z|[z+1,z.digits.join.to_i]}}}

Try it online!

Haskell, 71 60 bytes
g[1]
g l x|elem x l=0|1>0=g([succ,read.reverse.show]<*>l)x+1

Try it online!
Considerably less efficient than 79037662's existing Haskell answer, but 2 13 bytes is 2 13 bytes.
Explanation:
g[1]

The relevant function: call g with [1] as its first argument, l.
g l x|elem x l=0

g takes two arguments, l and x, and returns 0 if l contains x.
|1>0=g( ... )x+1

Otherwise, it returns 1 plus its return value for a modified value of l:
[ ... ]<*>l

Apply each function from a list of functions to each element of l, returning the results in a flat list, using the Applicative instance of lists. succ adds 1, and...
read.reverse.show

takes the string representation of its argument, reverses it, then re-interprets it as whatever the type is of the other list elements.