text:
Find the best period in which to have invested in a S&P500 index fund
Here are the annual returns for a hypothetical S&P 500 stock index fund for each calendar year from 1928 to 2017, expressed as a multiplier. So in 1928 you might say "the index went up by 37.88%" which I've represented here by 1.3788.
1.3788, 0.8809, 0.7152, 0.5293, 0.8485, 1.4659, 0.9406, 1.4137, 1.2792, 0.6141,  1.2521, 0.9455, 0.8471, 0.8214, 1.1243,  1.1945, 1.138, 1.3072, 0.8813, 1,  0.9935, 1.1026, 1.2178, 1.1646, 1.1178,  0.9338, 1.4502, 1.264, 1.0262, 0.8569,  1.3806, 1.0848, 0.9703, 1.2313, 0.8819,  1.1889, 1.1297, 1.0906, 0.8691, 1.2009,  1.0766, 0.8864, 1.001, 1.1079, 1.1563,  0.8263, 0.7028, 1.3155, 1.1915, 0.885,  1.0106, 1.1231, 1.2577, 0.9027, 1.1476,  1.1727, 1.014, 1.2633, 1.1462, 1.0203,  1.124, 1.2725, 0.9344, 1.2631, 1.0446,  1.0706, 0.9846, 1.3411, 1.2026, 1.3101,  1.2667, 1.1953, 0.8986, 0.8696, 0.7663,  1.2638, 1.0899, 1.03, 1.1362, 1.0353,  0.6151, 1.2345, 1.1278, 1, 1.1341,  1.296, 1.1139, 0.9927, 1.0954, 1.1942

Source: https://www.macrotrends.net/2526/sp-500-historical-annual-returns
Challenge
Given as inputs:

the array of annual returns (but see Rule 2. below)
an array \$X\$ of \$1\le K \le 90\$ positive numbers (the amounts to invest in each year of the investment period)

write a program or function that outputs what would have been the "best" \$K\$ consecutive year period to have invested the amounts in \$X\$, where:

each amount is invested at the beginning of a year.
anything left after each year is reinvested at the beginning of each subsequent year.
"best" means the largest amount at the end of the \$K\$ year period.

Rules

This is code-golf, so the fewest bytes in each language wins. Standard rules apply. Explanations encouraged.
If you don't like the way I've represented the array of annual returns, you can change them to any other array of 90 numbers that you prefer.
You can output the best \$K\$ year period in any consistent manner (e.g. 0-indexed or 1-indexed, the first and/or the last year to have invested, etc.) but you need to say what your output represents if it isn't obvious.
In case of a tie, output any or all correct answers.

Example calculation
Suppose \$X = [ 10000, 20000, 30000 ]\$.
If you had invested these amounts in 1928, 1929, and 1930 (the 1-indices 1, 2, and 3) you would have ended up with 42743.10. Sad.
But if you had invested those amounts in 2014, 2015, and 2016 (the 1-indices 87, 88, and 89) you would have ended up with 66722.66. A bit better.
It turns out the best three year period to have invested these amounts would have been 1995, 1996, and 1997 (1-indices 68, 69, and 70), resulting in 91942.91. Nice.
Test cases
1-indexed, first year of optimal period
[ 1, 2, 3 ]                          ->  68
[ 1 ]                                ->   6
* any array of length 90 *           ->   1
[ 1, 1 ]                             ->  27
[ 1, 2 ]                             ->   8
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]  ->  62
[ 1, 2, 3, 4, 5, 4, 3, 2, 1 ]        ->  64
* 1 repeated 20 times *              ->  53

Rule 2 says we can replace them with any other array of 90 numbers. I assume it isn't valid to replace it with an array that is 1 followed by 89 0s, so that 1 is always the correct answer? Or did you mean "take whatever input you want, but the number that gets output has to match the test cases"?

@KamilDrakari you can do any 1-1 transformation you like. You do need to end up with the actual correct answer, though. The idea is that someone might prefer cumulative returns, or those returns minus 1. It's there for flexibility. But if there's also some hidden golfing opportunity, so be it.

@ngm okay so it's "you can encode this input in whatever way you want" rather than "your answer only needs to work for a specific value for this input, and you get to choose what that is"

@KamilDrakari yes, although not quite whatever way you want - you are still limited to an array with 90 elements.

"So in 1927 you might say..." - I think you mean 1928.

Jelly, 9 bytes
PÐƤ⁹L¤ƤḋM

A dyadic link which yields a list of all the maximal starting 1-based indices.
Try it online!
(or ṡL}PÐƤ€ḋM)
How?
PÐƤ⁹L¤ƤḋM - Link: list of returns, list of nominal investments
      Ƥ   - for infixes of (the returns)...
          - ...of length:
     ¤    -               nilad followed by links as a nilad:
   ⁹      -                 chain's right argument (nominals)
    L     -                 length
          - ...do:
 ÐƤ       -        for post-fixes:
P         -          product
       ḋ  - dot-product (each) with (the nominals)
        M - maximal indices

Japt, 25 bytes
ãVl)míV ®rÈ+YÌ *Yg}0
bUrw

Try it online!
0-indexed output.
Explanation, with U as the list of returns and V as the list of investments:
ã                       :Get subsections of U
 Vl)                    : with the same length as V
    m                   :For each of those sections
     í                  : pair each element with
      V                 : the corresponding element from V
        ®          0    :Calculate the investment results of each by:
         r        }     : for each year:
          È+            :  add the result of the previous year
            YÌ          :  to this year's investment
               *Yg      :  and multiply by this year's return

b                       :Get the index of
 Urw                    : the maximum

Bonus cheating answer:
Japt, 13 bytes
OvUÎò3 ®n dÃq

Try it online!
Takes the list of returns as this array, which is an array of 90 strings where each string contains a base-10 integer padded to 1929 digits; I believe this technically meets the requirements. The "Try it" link only has the first element of the "returns" list because the full thing broke the permalink generator, but that's the only one that gets used. You can paste in the whole thing from the pastebin if you want.
Explanation:
As mentioned, only the first element of the "returns" array is actually used; every other element is 0 in the pastebin and ignored by the program. The first element is generated by this, which takes the string representation of a Japt program, turns each character into a 3 digit number, and joins those numbers into a new string of just digits. The code being encoded is this, which is basically my main answer adjusted to hard-code the returns. Then the "answer" program is just:
  UÎ             :Get the first element
    ò3           :Cut it into slices of length 3
       ®n        :Convert those strings to numbers
          dÃ     :Convert those numbers to characters
            q    :Join all the characters into one string
Ov               :Execute it as Japt

I'm not sure if the 13 byte version follows the default rules (encoding actual code into flexible inputs seems like a loophole), but I like it anyway!

@ngm I mean, I called it a cheat answer and tacked it on to a real answer for a reason. I was mainly just trying to stretch the limits of "any other array of 90 numbers that you prefer".

JavaScript (ES6), 73 bytes
Takes input as (annual_returns)(X). The result is 0-indexed.
a=>x=>a.map((_,i)=>x.map((c,j)=>(t=(t+c)*a[i+j])>m&&(r=i,m=t),t=0),m=0)|r

Try it online!

J, 48 bytes
1+[:(i.>./)[:({:@[*{.@[+*/@])/"2[(|.@,."1)#@[]\]

Try it online!
ungolfed
1 + [: (i. >./) [: ({:@[ * {.@[ + */@])/"2 [ |.@,."1 #@[ ]\ ]

how
Take input list (eg, 123) on left, data on right.
#@[ ]\ ] Chop up the data into infixes whose length matches the input:
1.3788 0.8809 0.7152
       0.8809 0.7152 0.5293
              0.7152 0.5293 0.8485

[    ,."1 now zip each of those groups of 3 with the input list
1      2      3
1.3788 0.8809 0.7152
       1      2      3
       0.8809 0.7152 0.5293
              1      2      3
              0.7152 0.5293 0.8485

 |.@    and reverse them:
3      2      1
0.7152 0.8809 1.3788

(verb to insert)/"2 Between the items of each zipped group of 3, insert the
verb in parentheses.
3             2             1
        VERB          VERB
0.7152        0.8809        1.3788

({:@[ * {.@[ + */@]) is the inserted verb, which will reduce each item of the list of zipped groups of threes down to one number, which is the amount
earned over that group of years:
          2. plus the first      1. */] = product of right args
             (top) item on left
              +-+     +--------+
              |2|  +  |    1   |
              +-+     |    *   |
                      | 1.3788 |
             *        +--------+

          0.8809

          3. Multiply that sum by the bottom
             number on the left.

(i. >./) Take the list thus reduced and find the index of the max.
1 + [: And add one

Python 2, 97 bytes
lambda r,v:max(range(len(r)-len(v)+1),key=lambda i:reduce(lambda x,(a,b):(x+a)*b,zip(v,r[i:]),0))

Try it online!
Returns 0-indexed

The last item of r should be 1.1942. Also, len(r) is 90.

@EriktheOutgolfer Fixed

Jelly, 11 bytes
ṡ⁹L¤U×\€UḋM

Try it online!
The return factor on a deposit is the cumulative product of the return factors in the years until the end of the K year period. If we're allowed to take the input in reverse and output a year number as 2018-[end date], the 10 bytes solution ×\⁹L¤Ƥ×S€M works.
ṡ                All overlapping slices of left input of length:
 ⁹L¤               length(right input)
                 Calculate cumulative returns list for each possible year:
    U              Reverse each element of the result
     ×\€           Take the cumulative product
        U          Reverse again
         ḋ      Dot product with the deposits list.
                The final balance when invested in each year.
          M     Get all indices of maximum values

ṡL} saves a byte over ṡ⁹L¤ (my alternative 9 byter, ṡL}PÐƤ€ḋM is effectively a more golfed version)

@JonathanAllan I'm still learning Jelly. How exactly does } work-- is it always equivalent to ⁹[monad]¤?

No, it's not exactly equivalent. The } quick treats the monad to its left as if it were a dyad and uses the right argument as the left input to that dyad (doing nothing with the left argument), as such the parsing of code containing L} is as if that were a dyad, while the parsing of the code containing ⁹L¤ is as if that were a nilad - if you try the replacement in Erik's code it wont work as the next part of the chain is a dyad (while the next in yours is a monad).

05AB1E, 21 20 bytes
Œsgùεø0©\vy`s®+*©]Zk

Way too long..
0-indexed.
Try it online or verify all test cases.
Explanation:
Œ                  # Get all sublists of the (implicit) input-list of stock-changes
 s                 # Swap to take the second (implicit) input-list of investments
  g                # And take its length
   ù               # Only leave sublists of that size
ε                  # Map each to:
 ø                 #  Create pairs with the second (implicit) input-list of investments
  0©               #  Store 0 in the register
    \              #  Discard the 0 from the stack
     vy            #  Loop `y` over the pairs
       `           #   Pop and push both values of the pair to the stack
        s          #   Swap them
         ®+        #   Add the value from the register to the investment amount
           *       #   And multiply it by the current number of the sublist
            ©      #   And then replace the value in the register with this
             ]     # Close both the loop and map
              Z    # Take the max of the mapped sublists (without popping the list)
               k   # Determine the index of that max (and output implicitly)

Jelly, 15 bytes
ṡ⁹L¤ż€+Ṫ×Ḣʋƒ€0M

Try it online!


text:
Densely packed decimal (DPD) to decimal

For nandgame fans: Please try out DPD to decimal in logic gates too!

Background
Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three decimal digits (000 to 999) in 10 bits, which is much more efficient than naive BCD (which stores one digit in 4 bits).
Notations

The lowercase letters a to i are the bits that are copied to the decimal representation.
0 and 1 are the exact bits in the input or output bit patterns.
x bits are ignored in the conversion.

Conversion table
The following is the conversion table from 10 bits of DPD to three decimal digits. Each decimal digit is represented as 4-bit binary (BCD). Both sides are written left to right from the most significant digit to the least.
Bits                 =>  Decimal         (Digit range)
a b c d e f 0 g h i  =>  0abc 0def 0ghi  (0-7) (0-7) (0-7)
a b c d e f 1 0 0 i  =>  0abc 0def 100i  (0–7) (0–7) (8–9)
a b c g h f 1 0 1 i  =>  0abc 100f 0ghi  (0–7) (8–9) (0–7)
g h c d e f 1 1 0 i  =>  100c 0def 0ghi  (8–9) (0–7) (0–7)
g h c 0 0 f 1 1 1 i  =>  100c 100f 0ghi  (8–9) (8–9) (0–7)
d e c 0 1 f 1 1 1 i  =>  100c 0def 100i  (8–9) (0–7) (8–9)
a b c 1 0 f 1 1 1 i  =>  0abc 100f 100i  (0–7) (8–9) (8–9)
x x c 1 1 f 1 1 1 i  =>  100c 100f 100i  (8–9) (8–9) (8–9)

Task
Convert 10 bits of DPD to 3 digits of decimal.
Test cases
DPD           Decimal
0000000101    005
0001100011    063
0001111001    079
0000011010    090
0001011110    098
1010111010    592
0011001101    941
1100111111    879
1110001110    986
0011111111    999
1111111111    999  * Output is same regardless of the `x` bits

Input
The default input format is a list of 10 bits. The bits should follow the exact order above, or the reverse of it. You may choose to use an equivalent string or integer representation instead. Unlike my other challenges, reordering or using nested structures is not allowed.
For the input [1, 1, 0, 0, 0, 1, 0, 1, 0, 0], the following formats are allowed:

List of bits: [1, 1, 0, 0, 0, 1, 0, 1, 0, 0]
String: "1100010100"
Binary integer: 788 or 0b1100010100
Decimal integer: 1100010100
Reversed: [0, 0, 1, 0, 1, 0, 0, 0, 1, 1] and reversed in any other formats above

The following formats are NOT allowed:

Arbitrary reordering of bits: [0, 0, 0, 0, 0, 1, 1, 1, 0, 1]
Nested structures: [[1, 1, 0], [0, 0, 1], [0, 1, 0, 0]] or [0b110, 0b001, 0b0100]

Output
The default output format is a list of 3 decimal digits. Each digit should be represented as 0 to 9, either an integer or a character. As in input, you can choose string or integer representation. If you choose integer representation, leading zeroes can be omitted.
Scoring & winning criterion
Standard code-golf rules apply. The shortest program or function in bytes for each language wins.

JavaScript (ES6), 112 bytes
All credit for this shorter version goes to @nwellnhof.
Takes input as an integer. Returns an array of three decimal digits.
n=>[(x=n>>4,y=x>>3,q=n/2&55,p=q%8)>5&&q-39?8|y&1:y,(p&5^5?x&6:q-23?8:y&6)|x&1,(p<5?p*2:p<6?x&6:p%q<7?y&6:8)|n&1]

Try it online!

JavaScript (ES6), 118 117 bytes
Takes input as an integer. Returns an array of three decimal digits.
n=>[(x=n>>4&7,y=n>>7,p=n/2&7)>5&&p<7|x/2^2?8|y&1:y,(p<7?p-5?x:8:x/2^1?8:y&6)|x&1,(p<5?p*2:p<6?x&6:p<7|x<2?y&6:8)|n&1]

Try it online!
How?
Instead of trying to apply the 'official' algorithm, this code is based on some kind of reverse-engineering of the patterns that can be found in the expected results.
Given the input integer \$n\$, we compute:
$$\begin{align}&x=\left\lfloor\frac{n}{16}\right\rfloor \bmod 8\\
&y=\left\lfloor\frac{n}{128}\right\rfloor\\
&p=\left\lfloor\frac{n}{2}\right\rfloor \bmod 8\end{align}
$$
Example: first digit (hundreds)
x     | 0                | 1                | 2                | 3
n & 1 | 0101010101010101 | 0101010101010101 | 0101010101010101 | 0101010101010101
p     | 0011223344556677 | 0011223344556677 | 0011223344556677 | 0011223344556677
------+------------------+------------------+------------------+-----------------
y = 0 | 0000000000008888 | 0000000000008888 | 0000000000008888 | 0000000000008888
y = 1 | 1111111111119999 | 1111111111119999 | 1111111111119999 | 1111111111119999
y = 2 | 2222222222228888 | 2222222222228888 | 2222222222228888 | 2222222222228888
y = 3 | 3333333333339999 | 3333333333339999 | 3333333333339999 | 3333333333339999
y = 4 | 4444444444448888 | 4444444444448888 | 4444444444448888 | 4444444444448888
y = 5 | 5555555555559999 | 5555555555559999 | 5555555555559999 | 5555555555559999
y = 6 | 6666666666668888 | 6666666666668888 | 6666666666668888 | 6666666666668888
y = 7 | 7777777777779999 | 7777777777779999 | 7777777777779999 | 7777777777779999

x     | 4                | 5                | 6                | 7
n & 1 | 0101010101010101 | 0101010101010101 | 0101010101010101 | 0101010101010101
p     | 0011223344556677 | 0011223344556677 | 0011223344556677 | 0011223344556677
------+------------------+------------------+------------------+-----------------
y = 0 | 0000000000008800 | 0000000000008800 | 0000000000008888 | 0000000000008888
y = 1 | 1111111111119911 | 1111111111119911 | 1111111111119999 | 1111111111119999
y = 2 | 2222222222228822 | 2222222222228822 | 2222222222228888 | 2222222222228888
y = 3 | 3333333333339933 | 3333333333339933 | 3333333333339999 | 3333333333339999
y = 4 | 4444444444448844 | 4444444444448844 | 4444444444448888 | 4444444444448888
y = 5 | 5555555555559955 | 5555555555559955 | 5555555555559999 | 5555555555559999
y = 6 | 6666666666668866 | 6666666666668866 | 6666666666668888 | 6666666666668888
y = 7 | 7777777777779977 | 7777777777779977 | 7777777777779999 | 7777777777779999

Algorithm:

If \$p<6\$, we have \$d=y\$
If \$p=6\$, we have \$d=8+(y\bmod2)\$
If \$p=7\text{ AND }(x<4\text{ OR }x>5)\$, we have \$d=8+(y\bmod2)\$
If \$p=7\text{ AND }(x=4\text{ OR }x=5)\$, we have \$d=y\$

As JS code:
p > 5 && p < 7 | x / 2 ^ 2 ? 8 | y & 1 : y

Your approach is similar to my C answer which uses another temporary variable. After golfing my initial C solution a bit more, a port to JavaScript results in 112 bytes.

JavaScript (Node.js), 126 119 117 112 111 bytes
(a,b,c,d,e,f,g,h,i,j)=>[(g&h&i+(b+=a*4+b,e+=d*4+e)!=5?8:b)+c,(g&i?h+e-3?8:b:e)+f,(g?h<i?e:h>i*e?b:8:h*4+i*2)+j]

Try it online!
-5 bytes thanks @tsh (and 2 by myself) So l can make more effort than I expected.
-2 more bytes using @tsh's technique!
-5 bytes thanks @Arnauld
-1 byte thanks @Neil
Input as a list of 10 bits (as 10 arguments), output as a list of 3 digits.

(!i|!d|e) -> i+l!=5; (d|e|!h) -> h+l!=1

(g?h-i|h&!e?h?b:e:8:h*4+i*2) -> (g?h<i?e:h>i*e?b:8:h*4+i*2) saves another byte. (I checked this time...)

Python 3, 229 ... 97 96 bytes
lambda a:[[a&6,a>>4&6,a>>7&6,8][b"  eW7B]Oys"[~a&8or~a&6or~6|a>>4]%x&3]|a>>x%9&1for x in[7,4,9]]

Try it online!
-4 bytes by @xnor
-6 bytes by @nwellnhof
Formatted:
h = lambda a:[
    [a&6, a>>4&6, a>>7&6, 8][              List to take high bits from
        b"  eW7B]Oys"[                     10 char string; where to get high bits for
                                             indicator values 1-8. 0th,1st chars not used.
            ~a&8 or ~a&6 or ~6|a>>4]       Compute indicator (by @nwellnhof)
        %x&3]                              High bits of each digit
    | a >> x%9 & 1                         bitwise OR with low bit of each digit
    for x in [7,4,9]]

Explanation
Because I originally wanted to implement this in Jelly, I take a different approach from most answers here, which is simple and perhaps suited to a golfing language. Though the golfed function takes an integer, let the input as a bit list be [a0,a1,...,a9]. Then we can derive three values from the input

The low bits [a2,a5,a9]: These will always be the low bits of [d0,d1,d2] respectively.
The high bits [2*a0a1,2*a3a4,2*a7a8,8]: The high bits of each digit will be one of these.
The indicator bits, [a3,a4,a5,a7,a8], determining how to get the high bits of each digit. We compute the indicator (between 1 and 8) as follows:

If a5 == 0, the indicator is 8 (originally 0, but using 8 instead saves a byte)
If a3 nand a4, the indicator is 6 - 2*a3a4
Otherwise the indicator is 2*a7a8 + 1 (actually calculated as a negative number).

Then the nth digit can be elegantly computed as high_bits[arr[indicator][n]] | low_bits[n] by the table below, which is compressed into a string.
arr = [
    [0,1,2],
    [3,1,2],
    [1,3,2],
    [2,1,3],
    [2,3,3],
    [3,2,3],
    [3,3,2],
    [3,3,3]
]

You can used a bytestring b"..." to replace converting with ord.

@nwellnhof Ha, I just found the same thing! Will credit you anyway.

b"$>6;-/'?"[a&8and(~a&6or a>>4&6|1)] saves another four bytes.

@nwellnhof I think a modulo chain is the way to go here, but if not yours would certainly work.

C (gcc), 138 129 bytes
f(w){int t=w/2&55,s=t%8,v=w/16,u=v/8;w=((s<6|t==39?u:8|u%2)*10+v%2+(s&5^5?v&6:t-23?8:u&6))*10+w%2+(s<5?s*2:s<6?v&6:s%t<7?u&6:8);}

Try it online!
First extracts some bits into variables s and t, so that the eight rows of the conversion table can be identified by:
1.  s < 4              u v w¹
2.  s = 4              u v 8¹
3.  s = 5              u 8 v
4.  s = 6              8 v u
5.  s = 7, t =  7      8 8 u
6.  s = 7, t = 23      8 u 8
7.  s = 7, t = 39      u 8 8
8.  s = 7, t = 55      8 8 8

¹ Can be computed with s*2

Then sets up u and v with divisions (right shifts), so that u, v and the input w contain the lower three BCD bits in positions 0-2. The rest is bit shuffling depending on s and t. Two notable tricks are:
s&5^5  // Rows 1, 2 and 4.
s%t<7  // Rows 1-5.

A port of Shieru Asakoto's Javascript solution is only 124 bytes:
f(a,b,c,d,e,f,g,h,i,j){a=(((g&h&i+(b+=a*4+b,e+=d*4+e)!=5?8:b)+c)*10+(g&i?h+e-3?8:b:e)+f)*10+(g?h-i|h&!e?h?b:e:8:h*4+i*2)+j;}

Try it online!

I think it can be shortened to: f(b){int a=b/2%8,e=b&110,c=b/16,d=c/8;b=10*(10*(d%2|(6>a|78==e?d:8))+c%2+(3<a&a%2?e-46?8:d&6:c&6))+b%2+(4>a?b&6:a-5?a-6&&e-14?8:d&6:c&6)};

@MCCCS Your code seems to be 138 bytes as well.

Ruby, 153 ... 119 117 bytes
->n{n+=n&896;a,b,c=n&1536,n&96,n&14;"%x"%n+=c<9?0:2036+[b/16-b-1918,r=a>>8,[r+126,a/16-26,a-1978,38][b/32]-a][c/2-5]}

Try it online!
How it works:
->n{n+=n&896;

This is the starting point: convert to BCD by shifting 3 bits to the left, which works for most of the patterns.
a,b,c=n&1536,n&96,n&14;

Get the middle bits of each nibble (and one extra bit of the third nibble, but mask the least significant bit).
"%x"%n+=c<9?0

If the third digit is less than 10 (less than 9 because we never cared for the LSB anyway), we're set: this is plain BCD, we can output the hex without changing anything
:2036+[b/16-b-1918,r=a>>8,[r+126,a/16-26,a-1978,38][b/32]-a][c/2-5]}

Otherwise do some black magic by shifting bits around and adding magic numbers until we get the result we want.

Jelly, 51 48 40 39 bytes
&\‘f4;s3ɓạ4ḅ-œ?µ/Ḥ
“MY-€-Y¤©¡‘Dịs3Ḅç+ƭ/

Try it online!
Algorithm
With the exception of list indices, all integers in this section are written in binary.
Given input \$\alpha\beta\gamma\delta\varepsilon\zeta\eta\theta\iota\kappa\$, we first construct the arrays \$[\eta\eta, \theta\iota, \delta\varepsilon]\$, \$[\alpha\beta, \delta\varepsilon, \theta\iota]\$, and \$[\gamma, \zeta, \kappa]\$.

If \$\eta\eta = 00\$, all three output digits are low (\$0000\$ to \$0111\$).
If \$\eta\eta = 11\$ but \$\theta\iota < 11\$, exactly one output digit is high (\$1000\$ or \$1001\$).
If \$\eta\eta = \theta\iota = 11\$ but \$\delta\varepsilon < 11\$, exactly two output digits are high.
If \$\eta\eta = \theta\iota = \delta\varepsilon = 11\$, all three output digits are high.

If we count the number of leading \$11\$'s \$[\eta\eta, \theta\iota, \delta\varepsilon]\$, create an array of a matching number of \$100\$'s, concatenate it with \$[\alpha\beta, \delta\varepsilon, \theta\iota]\$, and split the result into subarrays of length three, we get the following results in each case.

\$[[\alpha\beta, \delta\varepsilon, \theta\iota]]\$
\$[[100, \alpha\beta, \delta\varepsilon], [\theta\iota]]\$
\$[[100, 100, \alpha\beta], [\delta\varepsilon, \theta\iota]] = [[100, 100, \alpha\beta], [\delta\varepsilon, 11]]\$
\$[[100, 100, 100], [\alpha\beta, \delta\varepsilon, \theta\iota]] = [[100, 100, 100], [\alpha\beta, 11, 11]]\$

In the first and last case, we just have to zip the first array with \$[\gamma, \zeta, \kappa]\$, yielding \$[\alpha\beta\gamma, \delta\varepsilon\zeta, \theta\iota\kappa]\$ in the first case and \$[100\gamma, 100\zeta, 100\kappa]\$ in the last.
The remaining two cases are similar, but the arrays \$[100, \alpha\beta, \delta\varepsilon]\$ and \$[100, 100, \alpha\beta]\$ have to be reordered, according on the values of \$[\theta\iota]\$ and possibly \$\delta\varepsilon\$.
In the second case, the six permutations of \$[100, \alpha\beta, \delta\varepsilon]\$ are \$[100, \alpha\beta, \delta\varepsilon]\$, \$[100, \delta\varepsilon, \alpha\beta]\$, \$[\alpha\beta, 100, \delta\varepsilon]\$, \$[\alpha\beta, \delta\varepsilon, 100]\$, \$[\delta\varepsilon, 100, \alpha\beta]\$, and \$[\delta\varepsilon, \alpha\beta, 100]\$.
By computing \$100-\theta\iota\$, we map \$00\$, \$01\$, and \$10\$ to four, three and two, selecting the permutations \$[\alpha\beta, \delta\varepsilon, 100]\$, \$[\alpha\beta, 100, \delta\varepsilon]\$, and \$[100, \delta\varepsilon, \alpha\beta]\$.
After zipping the result with \$[\gamma, \zeta, \kappa]\$, we get \$[\alpha\beta\gamma, \delta\varepsilon\zeta, 100\kappa]\$, \$[\alpha\beta\gamma, 100\zeta, \delta\varepsilon\kappa]\$, or \$[100\gamma, \delta\varepsilon\zeta, \alpha\beta\kappa]\$.
In the third case, the permutations (with duplicates) of \$[100, 100, \alpha\beta]\$ are \$[100, 100, \alpha\beta]\$, \$[100, \alpha\beta, 100 ]\$, \$[100, 100, \alpha\beta]\$, \$[100, \alpha\beta, 100 ]\$, \$[\alpha\beta, 100, 100]\$ and \$[\alpha\beta, 100, 100]\$.
By computing \$(100 - \theta\iota) - (100 - \delta\varepsilon) = \delta\varepsilon - \theta\iota = \delta\varepsilon - 11\$, we map \$00\$, \$01\$, and \$10\$ to three, four, and five modulo six, selecting the permutations \$[100, 100, \alpha\beta]\$, \$[100, \alpha\beta, 100 ]\$, and \$[\alpha\beta, 100, 100]\$.
After zipping the result with \$[\gamma, \zeta, \kappa]\$, we get \$[100\gamma, 100\zeta, \alpha\beta\kappa]\$, \$[100\gamma, \alpha\beta\zeta, 100\kappa]\$, or \$[\alpha\beta\gamma, 100\zeta, 100\kappa]\$.
Code
“MY-€-Y¤©¡‘Dịs3Ḅç+ƭ/  Main link. Argument: A (array of 10 bits)

“MY-€-Y¤©¡‘           Array literal; yield [77, 89, 45, 12, 45, 89, 3, 6, 0].
           D          Decimal; yield
                      [[7,7], [8,9], [4,5], [1,2], [4,5], [8,9], [3], [6], [0]].
            ị         Retrieve the elements of A at those indices.
                      Indexing is 1-based and modular, so 1 is the first index, while
                      0 is the last.
             s3       Split the results 2D array of bits into chunks of length 3.
               Ḅ      Convert the 9 arrays of bits from binary to integer.
                ç+ƭ/  Reduce the resulting array (length 3) once by the helper link,
                      then by addition.

&\‘f4;s3ɓạ4ḅ-œ?µ/Ḥ    Helper link. Arguments: B, C (arrays of three integers each)

&\                    Cumulatively reduce B by bitwise AND.
  ‘                   Increment the results by 1.
   f4                 Filter; keep only integers equal to 4.
     ;                Concatenate the result with C.
      s3              Split the result into (one or two) chunks of length 3.
        ɓ      µ/     Reduce the array of chunks by the following chain.
         ạ4               Take the absolute difference of the integers in the right
                          chunk and the integer 4.
           ḅ-             Convert the resulting array from base -1 to integer, i.e.,
                          map [x] to n = x and [x, y] to n = y - x.
             œ?           Take the n-th permutation of the left chunk.
                 Ḥ    Unhalve; multiply the resulting integers by 2.

Retina 0.8.2, 191 181 bytes
(...)(...)
:$1,$2;
..(.),11(.);111
100$1,100$2;100
(10|(..)(.,)01)(.);111
100$3$2$4;100
(..)(.),(00.);111
100$2,1$3;0$1
(..)((.{5});110|(.);101)
100$3$4;$1
1
01
+`10
011
.0+(1*)
$.1

Try it online! Link includes test cases. Edit: Saved 10 byte by not padding digits to 4 bits except where necessary. Explanation:
(...)(...)
:$1,$2;

Insert separators so that each digit can be converted to decimal separately. This effectively handles the first two cases in the conversion table.
..(.),11(.);111
100$1,100$2;100

Handle the last (eighth) case in the conversion table.
(10|(..)(.,)01)(.);111
100$3$2$4;100

Handle the sixth and seventh cases in the conversion table.
(..)(.),(00.);111
100$2,1$3;0$1

Handle the fifth case in the conversion table.
(..)((.{5});110|(.);101)
100$3$4;$1

Handle the third and fourth cases in the conversion table.
1
01
+`10
011
.0+(1*)
$.1

Perform binary to decimal conversion.

Python 2, 157 bytes
lambda a,b,c,d,e,f,g,h,i,j:[c+[a*4+b*2,8][g*h*~(d*~e*i)],f+[d*4+e*2,8,a*4+b*2][g*i+(d<e)*g*i*h],j+[h*4+i*2,[8,[a*4+b*2,d*4+e*2][h<i]][h^i or(h&i-(d|e))]][g]]

Try it online!

Clean, 238 ... 189 bytes
-2 bytes thanks to Neil
import StdEnv
$a b c d e f g h i j=100*(c+2*b+4*a)+10*(f+2*e+4*d)+j+2*i+4*h-2*(h*(99*b+198*a-394)+i*(9*e+18*d+h*(e+2*d-4+(b+2*a-4)*(1-10*e-100*d+110*e*d))-35)-4)*g+0^(e+d)*(2*b+4*a-8*i*h*g)

Try it online!
Takes a 'list' of 10 bits in the form of 10 arguments, using a direct formula to compute the result.

In i*(9*e+19*d+i*...), that second i* looks unnecessary.

@Neil You're right, it is, thanks.

Perl 5, 195 bytes
sub f{$n=shift;@p=((map{($n>>$_&3)*2}(8,5,1)),8);for(16390,28935,29005,227791,29108,225788,226803,228863){return 2*$n&256|$n&17|$p[$_>>4&3]<<8|$p[$_/4&3]<<4|$p[$_&3]if($_>>12&$n/2)==($_>>6&63);}}

Try it online
I know 195 bytes is far too much for this contest, but I had no idea how to further compress the Perl code. Suggestions?
Explanation of the code
In a more readable version, the code intention should become apparent:
sub dpd {
  my $n = shift;
  my $v=2*($n&128)|$n&17;
  my @p=((map{($n>>$_&3)*2}(8,5,1)),8);
  for (16390,28935,29005,227791,29108,225788,226803,228863) {
    return $v |$p[$_>>4&3]<<8|$p[$_>>2&3]<<4|$p[$_&3]
      if(($_>>12&$n/2)==($_>>6&63));
  }
}

In the rules for DPD encoding, each line is encoded into a 18 bit value, segmentation into (6,6,(2,2,2)) bits.

The first 6 bits are an appropriate bit mask for the bits 1 (=h) to 6 (=d) of the input (bit 4 = f is redundant, but it simplifies the evaluation code to have it included).
The next 6 bits are the value bits for this bit mask. The values are checked on all places where the bit mask has a 1 value.
The following 3*2 bits contain the indices for the array @p for the 3-bit sequences which are to spliced into bits 11-9, 7-5 and 3-1 of the result.
The array @p is constructed from bits 9-8, 6-5, 3-2 of the input, and the number 8 as fourth member
The bits at position 7,4 and 0 of the input are transferred directly into bits 8,4 and 0 of the result.

For example, the first number in the list, 16390, which is 100000000000110 as a bit field, carries the following information:
000100 : bit mask says: only consider bit 3 of the input
000000 : bit values say: bit 3 should be 0
00     : use '0ab' as higher bits of first digit
01     : use '0de' as higher bits of second digit
10     : use '0gh' as higher bits of third digit

05AB1E, 84 bytes
Port of KimOyhus' answer to 05AB1E.
•4’7þ2Ô€iΘEuĆΣk4Ð€:ΘΛs‡CaΔʒì₁3¶rdiMß¡þи иø-˜)Â∍DY—WûQ@—Mā}Γ¤ÒÙ]p•44в2ôvÐyèP≠«}4ôC3.£

Try it online!
Rough explanation:
•yadayada•44в2ô   # encoded list of nand gates
v                 # for each gate
 ÐyèP≠            # compute the output of the gate
      «           # append it to the input
       }          # end of the loop
4ô                # split the list of bits in groups of 4
  C               # convert each from binary to decimal
   3.£            # keep the last 3 numbers
                  # implicit output

05AB1E, 104 103 101 bytes
•3γã•S£©4èUXтÌ‹XSPVY®2èDˆTQ*~i0®нëт}®1èY¯`*i0®нëY_Xт>Ê*i0¯`ëт]®3èY¯`_*X110Q~i0®нëXт›iYiтë0¯`ëX]®θJ4ôC

Definitely not the right language for this kind of challenge, but ah well..
Input as string, output as list of three digits.
Try it online or verify all test cases.
Explanation:
We have the following eight scenarios to consider:
     1st 2nd 3rd 4th 5th 6th                          1st digit    2nd digit    3rd digit
1.   ab  c   de  f   0gh i   →   0abc 0def 0ghi   →   '0'+1st 2nd  '0'+3rd 4th  5th     6th
2.   ab  c   de  f   100 i   →   0abc 0def 100i   →   '0'+1st 2nd  '0'+3rd 4th  5th     6th
3.   ab  c   gh  f   101 i   →   0abc 100f 0ghi   →   '0'+1st 2nd  '100'   4th  '0'+3rd 6th
4.   gh  c   de  f   110 i   →   100c 0def 0ghi   →   '100'   2nd  '0'+3rd 4th  '0'+1st 6th
5.   gh  c   00  f   111 i   →   100c 100f 0ghi   →   '100'   2nd  '100'   4th  '0'+1st 6th
6.   de  c   01  f   111 i   →   100c 0def 100i   →   '100'   2nd  '0'+1st 4th  '100'   6th
7.   ab  c   10  f   111 i   →   0abc 100f 100i   →   '0'+1st 2nd  '100'   4th  '100'   6th
8.   xx  c   11  f   111 i   →   100c 100f 100i   →   '100'   2nd  '100'   4th  '100'   6th

I first split the (implicit) input into chunks of size [2,1,2,1,3,1] and store that list in the register:
•3γã•     # Push compressed integer 212131
     S    # Convert it to a list of digits
      £   # Split the (implicit) input in chunks of that size
       ©  # Store it in the register (without popping)

See this 05AB1E tip of mine (section How to compress large integers?) to understand why •3γã• is 212131
Now we're first going to built the 0s and 1s for the first digit of the output. Scenarios 1,2,3,7 use '0'+1st+2nd; and scenarios 4,5,6,8 use '100'+2nd:
4è                  # Take the 5th item of the list
  U                 # Pop and store it in variable `X`
XтÌ‹                #  Check if `X` is below 102
                ~   # OR
   XSP              #  `X` is equal to 111
      VY            #  And store that result in variable `Y`
               *    #  and
        ®2è         #  Get the 3rd item from the list of the register
           Dˆ       #  Push it to the global array
             TQ     #  And check if it's equal to 10
i                   # If the combined check above is truthy (exactly 1):
 0                  #  Push 0 to the stack
 ®н                 #  Push the 1st item of the list to the stack
ë                   # Else:
 т                  #  Push 100 to the stack
}                   # Close the if-else
®1è                 # And push the 2nd item of the list to the stack

Then we're going to built the 0s and 1s for the second digit of the output. Scenarios 1,2,4 use '0'+3rd+4th; scenarios 3,5,7,8 use '100'+4th; and scenario 6 uses '0'+1st+4th:
Y                # Push `Y` (check if `X` equals 111)
   *             # and
 ¯`              # Push the item from the global array (3rd item of the list)
i                # If both checks above are truthy (exactly 1):
 0               #  Push 0 to the stack
 ®н              #  Push the 1st item of the list to the stack
ë                # Else:
 Y_              #  Push inverted `Y` (check if `X` does NOT equal 111)
       *         #  and
   Xт>Ê          #  Check if `X` (5th item of the list) does NOT equal 101
 i               #  If both checks above are truthy (exactly 1):
  0              #   Push 0 to the stack
  ¯`             #   Push the item from the global array (3rd item of the list)
 ë               #  Else:
  т              #   Push 100 to the stack
]                # Close both if-else cases
®3è              # And push the 4th item of the list to the stack

Then we're going to built the 0s and 1s for the third digit of the output. Scenarios 1,2 use 5th+6th; scenario 3 uses '0'+3rd+6th; scenarios 4,5 use '0'+1st+6th; and scenarios 6,7,8 use '100'+6th:
Y           #  Push `Y` (check if `X` equals 111)
    *       #  and
 ¯`_        #  Check if the item from the global array (3rd item of the list) is exactly 0
         ~  # OR
    X110Q   #  Check if `X` (5th item of the list) equals 110
i           # If the combined check above is truthy (exactly 1):
 0          #  Push 0 to the stack
 ®н         #  Push the 1st item of the list to the stack
ë           # Else:
 Xт›i       #  If `X` (5th item of the list) is larger than 100 (so 101/110/111):
     Yi     #   If `Y` (if `X` equals 111):
       т    #    Push 100 to the stack
      ë     #   Else:
       0    #    Push 0 to the stack
       ¯`   #    Push the item from the global array (3rd item of the list)
    ë       #  Else:
     X      #   Push `X` (5th item of the list) to the stack
]           # Close all if-else cases
®θ          # And push the last (6th) item of the list to the stack

Now we have all 0s and 1s on the stack, so we can convert it to the three output digits:
J     # Join the entire stack together
 4ô   # Split it into parts of size 4
   C  # Convert each part from binary to an integer (and output implicitly)

source: Stack Exchange

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

sort: votes


text:
Splitting The Bill
Task
Suppose that p pepole have to split a bill; each of them is identified by a triple (Name, n, k) made up of:

Name: the name;
n: the amount she/he has to pay;
k: the amount she/he actually paid.

The challenge here is to find out how much who owes whom.
Assumptions

Input and output can be in any convenient format.

p \$\in \mathbb{N}, \,\;\;\$n \$\in \mathbb{N}^{+},\;\$ k \$\in \mathbb{N}.\$

p \$\gt 1.\$

Names are unique strings of arbitrary length, composed of lower case alphabet characters.

Solution
The solution is represented by the minimum set of transactions among the p people; in particular they are triples (from, to, amount)

from: name of the person that gives money;
to: name of the person that receives money;
amount: amount of money of the transaction.

NOTE: The sum of all the debts (n) can differ from the sum of all the already payed amounts (k). In this case, you must add in the output ('owner', Name, amount) or (Name, 'owner', amount) in the format you have chosen. Any name will never be owner.The string 'owner' is flexible.
If several mimimum sets exist, select the one with the minimum sum of all the transaction amounts (absolute values); in case of a tie, choose one of them.
Test Cases:
inputs(Name,n,k):
[('a',30,40),('b',40,50),('c',30,15)]
[('a',30,30),('b',20,20)]
[('a',30,100),('b',30,2),('c',40,0)]
[('a',344,333),('b',344,200),('c',2,2)]
[('a',450,400),('b',300,300),('c',35,55)]

outputs(from, to, amount):
[('c','a',10),('c','b',5),('owner','b',5)] or [('c','b',10),('c','a',5),('owner','a',5)]
[]
[('owner','a',2),('b','a',28),('c','a',40)] PS: [('owner','a',2),('b','a',68),('c','b',40)] has the same number of transactions, but it is not a valid answer, because the total amount of its transaction is greater than that of the proposed solution.
[('a','owner',11),('b','owner',144)]
[('a','owner',30),('a','c',20)]

This is code-golf: shortest code wins.

I think you should change "You have to output the most simplified scenario which requires least number of transactions." to "You have to output the scenario which requires least number of transactions. If multiple such scenarios exist choose one with the least total notional of transactions." since I believe it is clearer.

Nice challenge. But it will probably require more complex test cases to make sure that solutions really are always optimal.

What is "least total notional"?

Are we allowed to describe "Alice gives 10 to Bob" as either ('Alice','Bob',10) or ('Bob','Alice',-10)? (potentially both mixed in the same answer)

Both can be used, @Arnauld

@lirtosiast, See the 3rd example, that is what I mean. It should be the most simplified.

Related thesis. See section 2.4. (Beware: I think that the solution described may still be non-optimal in some cases.) Suggested test case taken from this document: [('Alice',10,18),('Bob',10,6),('Charlie',10,5),('David',10,17),('Eve',10,4),('Filip',10,13),('Gary',10,7)]: should be solved in 5 steps with a total transaction amount of $18.

@JonathanAllan still confused by the word “notional”.  where is that coming from?  based on test case 3 it looks like one should prefer answers where the same person does not both give and receive?  is that correct?  also why is that described as notional?

@Jonah I used "total notional" since the directions of the transactions should not be considered (just their absolute size), although I now realise it's somewhat redundant (as having two transactions that counteract each other wouldn't be considered once tie-breaking!). [Notional is just the term used in finance.]

"although I now realise it's somewhat redundant (as having two transactions that counteract each other wouldn't be considered once tie-breaking!)."  -- so what is the correct criteria we are minimizing.   i'm still confused lol.... @VedantKandoi

I think the right way would be to first minimize the number of transactions then minimize the total amount owed. If multiple cases still exist output any one of them. @JonathanAllan?

@VedantKandoi all ways have "total amount owed" equal to zero, you probably mean "total of transaction amounts".

JavaScript (ES6),  252 227 223 222  215 bytes
Takes input as [[n0, k0, name0], [n1, k1, name1], ...].
Transactions in the solution may be either positive or negative. The owner is called undefined.
a=>(m=g=(B,t,s)=>B.some(x=>x)?B.map((b,x)=>B.map((c,y)=>b*c<0&b*b<=c*c&&g(C=[...B],[...t,[a[x][2],b,a[y][2]]],s+a.length-1/b/b,C[C[y]+=b,x]=0))):m<s||(r=t,m=s))([...a.map(([x,y])=>t-(t+=y-x),t=0),t],[],a.push(g))&&r

Try it online!
Commented
a => (                              // a[] = input array
  m =                               // initialize m to a non-numeric value
  g = (B, t, s) =>                  // g = function taking: B = balances, t = transactions,
                                    //     s = score of the current solution
    B.some(x => x) ?                // if at least one balance is not equal to 0:
      B.map((b, x) =>               //   for each balance b at position x:
        B.map((c, y) =>             //     for each balance c at position y:
          b * c < 0 &               //       if b and c are of opposite sign
          b * b <= c * c &&         //       and |b| <= |c|,
          g(                        //       do a recursive call to g:
            C = [...B],             //         - with a copy C of B
            [ ...t,                 //         - append the new transaction to t[]
              [a[x][2], b, a[y][2]] //           in [from_name, amount, to_name] format
            ],                      //
            s + a.length - 1/b/b,   //         - add (a.length - 1/b²) to s
            C[C[y] += b, x] = 0     //         - update C[y] and clear C[x]
          )                         //       end of recursive call
        )                           //     end of inner map()
      )                             //   end of outer map()
    :                               // else:
      m < s ||                      //   if the score of this solution is lower than m,
      (r = t, m = s)                //   update r to t and m to s
)(                                  // initial call to g:
  [                                 //   build the list of balances:
    ...a.map(([x, y]) =>            //     each balance is equal to:
      t - (t += y - x),             //     due_value - paid_value
      t = 0                         //     keep track of the total t ...
    ),                              //
    t                               //   ... which is appended at the end of this array
  ],                                //   (this is the balance of the owner)
  [],                               //   start with t = []
  a.push(g)                         //   append a dummy owner to a[]; start with s = 1
) && r                              // return r

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


text:
Is this number a hill number?
A hill number is a number that has the same digit in the first & the last, but that's not all. In a hill number the first digits are strictly increasing until the largest digit, and after the largest digit, the last digits are strictly decreasing. The largest digit can be repeated but consecutively only, meaning no gaps by smaller numbers.
Here is an example of a hill number:
12377731 | 1237...             | ...731
^ same ^ | strictly increasing | strictly decreasing
---------+---------------------+---------------------
12377731
   ^^^ okay because largest digit can be repeated

This is not:
4588774 | ...8774
        |     ^^ not the largest digit
        |        so this has to be strictly decreasing
        |        but it's not, so not a hill number

Challenge
Given a positive integer, write a full program or a function that returns truthy for hill numbers but falsy on other values.
Notes:

Input & output can be in any reasonable format.
This is code-golf so shortest answer in each language wins!

Test Cases
12321 -> Truthy
1233321 -> Truthy
99 -> Truthy
3 -> Truthy
234567992 -> Truthy
5555555 -> Truthy
1232 -> Falsy
778896 -> Falsy
23232 -> Falsy
45566554 -> Falsy
5645 -> Falsy

What about 222222222? Is it a flat hill number?

222222222 is a hill number, largest digit is 2 and thus can be repeated

Is a string reasonable?

@frarugi87 See comment above.

Is 1230321 a hill number?

@HelloGoodbye That is clearly a volcano number.  (And no, I'd say it's definitely not a hill number by the definition given since the numbers don't strictly increase on one side and decrease on the other.)

@DarrelHoffman That's not what the description says—it says "the first digits are strictly increasing, and the last digits are strictly decreasing," which I think is true for the number I gave as an example.

@DarrelHoffman Yea, it should probably be a volcano number :P

@HelloGoodbye it's not a hill number.

@u_ndefined Why not?

@u_ndefined Obviously, but as I explained, it still fulfills your criteria for a hill number. And since this is a programming golf challenge, you criteria should be correctly formulated unless you want the task to be ambiguous. So my point was that you needed a more well formulated criteria for what counts as a hill number.

@HelloGoodbye see 23232, it's false

@u_ndefined That is an example of what is not a hill number, which is good think to include, but it is not a criteria.

Jelly, 8 bytes
_ƝṠÞ+SƊƑ

Try it online!
How it works
_ƝṠÞ+SƊƑ  Main link. Argument: n (integer)

_Ɲ        Take the differences of neighboring digits.
          This maps n = abcd to [a-b, b-c, c-d].
       Ƒ  Fixed; apply the link to the left and return 1 if the result is equal to
          its argument, 0 if not.
      Ɗ       Drei; combine the three links to the left into a monadic chain.
  ṠÞ              Sort the differences by their signs (negative, zero, positive).
     S            Take the sum of the differences, yielding 0 if and only if the
                  first digit is equal to the last.
    +             Add the sum to each difference.

JavaScript (ES6), 62 54 bytes
Takes input as a string. Returns a Boolean value.
s=>s[-[...s].some(p=q=n=>q>(q=Math.sign(p-(p=n))))]==p

Try it online!
Commented
s =>                  // s = input string
  s[                  // we will eventually access either s[0] or s[-1]
    -[...s].some(     // depending on the result of this some()
      p = q =         // initialize p and q to non-numeric values
      n =>            // for each digit n:
        q > (         //   compare q with
          q =         //   the new value of q,
          Math.sign(  //   defined as the sign of
          p - (p = n) //   the difference between the current digit and the previous one
        ))            //   yield true if the previous q is greater than the new q
    )                 // s[-1] being undefined, a truhty some() will force the test to fail
  ] == p              // otherwise: test if the 1st digit s[0] is equal to the last digit p

JavaScript (ES6), 65 bytes
A solution using a regular expression. Takes input as a string. Returns \$0\$ or \$1\$.
s=>/N(,-\d+)*(,0)*[^0-]*$/.test([...s].map(p=v=>p-(p=v)))&p==s[0]

Try it online!
How?
We first convert the number to a list of pairwise digit differences in \$[-9,9]\$:
[...s].map(p = v => p - (p = v))

Example:
"234567992" --> [ NaN, -1, -1, -1, -1, -1, -2, 0, 7 ]

This array is coerced to a string, which gives:
"NaN,-1,-1,-1,-1,-1,-2,0,7"

We apply the following regular expression:
 +-----------------------> the second 'N' of 'NaN'
 |    +------------------> a sequence of negative numbers
 |    |     +------------> a sequence of zeros
 |    |     |     +------> a sequence of positive numbers
 |    |     |     |  +---> end of string
 |    |     |     |  |
 |/¨¨¨¨¨¨\/¨¨¨\/¨¨¨¨\|
/N(,-\d+)*(,0)*[^0-]*$/

Finally, we also test if the last digit p is equal to the first digit s[0].

You can save 5 bytes by taking input as an array of digits.

@Shaggy I wish I could but this is apparently not allowed .

From the spec, with original emphasis: "Input & output can be in any reasonable format" - we usually consider a digit array a reasonable format for an integer.

Jelly, 11 bytes
DIµṠNṢƑaS¬$

Explanation:
D               Convert to a list of Digits.
 I              Increments; compute differences between successive elements.
  µ             Start new µonadic link.
   Ṡ              Find Ṡign of each increment
    N             then negate;
     ṢƑ           is the result invariant under Ṣorting?
                  If so, the increments consist of some positive numbers,
                     followed by some 0s, followed by some negative numbers,
                     which is what we want.
       a          Logical AND this result with
        S¬$       logical NOT of the Sum of the increments.
                  If the sum of the increments is zero, first and last digits are equal.

Try it online!

Pyth, 16 bytes
&SI_._MJ.+jQT!sJ

Try the test suite.
          jQT          input in base 10
       J.+             J = differences: [3,1,4,1] -> [-2,3,-3]
    ._M                Signs of each element of J
   _                   Reverse the list
 SI                    and check if it is Invariant under Sorting.
                       If this is true, J consists of some positive numbers,
                         followed by some 0s, followed by some negative numbers,
                         which is what we want.
            !sJ        Now we check the other hill condition by ensuring
                         sum(differences) = 0; i.e. the first and last digit are equal.
&                      We take the logical AND of both conditions.

Perl 6, 39 bytes
{.[0]==.tail&&[<=] $_ Z<=>.skip}o*.comb

Try it online!
Explanation
{ ... }o.comb  # Split into digits and feed into block
.[0]==.tail    # First element equals last
&&             # and
     $_ Z<=>.skip  # Pairwise application of three-way comparator
[<=]           # Results never decrease

I was literally seconds away from posting this lol.

Python 2, 114 112 bytes
lambda n:all((n[0]==n[-1])*sorted(set(x))==list(x)[::d]for x,d in zip(n.split(max(n)*n.count(max(n)),1),[1,-1]))

Try it online!

R, 65 bytes
Takes strings. Took the idea for checking sort invariance from the Pyth answer.
function(a)!sum(d<-diff(utf8ToInt(a)))&all(sort(k<-sign(d),T)==k)

Try it online!

05AB1E, 19 17 13 12 bytes
¥D.±Â{RQsO_*

-5 bytes by creating a port of @lirtosiast's Pyth answer.
Try it online or verify all test cases.
Explanation:
¥           # Push the deltas of the digits of the (implicit) input
            #  i.e. 4588774 → [1,3,0,-1,0,-3]
 D          # Duplicate this list
  .±        # Get the sign of each
            #  [1,3,0,-1,0,-3] → [1,1,0,-1,0,-1]
    Â       # Bifurcate (short for DR: Duplicate and Reverse copy)
            #  i.e. [1,1,0,-1,0,-1] → [-1,0,-1,0,1,1]
     {      # Sort the copy
            #  i.e. [-1,0,-1,0,1,1] → [-1,-1,0,0,1,1]
      R     # Reverse it
            #  i.e. [1,1,0,0,-1,-1]
       Q    # And check if they are equal
            #  i.e. [1,1,0,-1,0,-1] and [1,1,0,0,-1,-1] → 0 (falsey)
s           # Swap to get the list of deltas again
 O          # Take the sum
            #  i.e. [1,3,0,-1,0,-3] → 0
  _         # And check if it's exactly 0
            #  0 → 1 (truthy)
*           # Check if both are truthy (and output implicitly)
            #  i.e. 0 and 1 → 0 (falsey)

Â{RQ can alternatively be (Â{Q for the same byte-count, where ( negates each sign: Try it online.

J, 23 bytes
[:((0=+/)**-:*/:*)2-/\]

Idea stolen from the Jelly answers.  Just wanted to see how short I could make it in J.
Try it online!

MATL, 12 bytes
dZSd1<AGds~*

Try it online!
Explanation
Input is a string of digits. Output is a 1 or 0. The number 222222 is a hill number according to this program. Saved 2 bytes by copying Dennis' method for checking equality of the first and last digits.
d               % Takes the difference between digits
 ZS             % Calculate the sign.
   d            % Take the difference again.
    1<          % A number is a hill number if these differences are < 1.
      A         % Truthy iff above is all true OR if array is empty (necessary for short inputs)
       Gds      % Push the input, and sum all the differences.
          ~     % Negate
           *    % Multiply the two tests (=logical AND).

Python 2, 53 bytes
def f(s):x=map(cmp,s,s[1:]);s[:sorted(x)==x]!=s[-1]>_

Takes input as a string. Output is via presence or absence of an exception.
Try it online!

Python 2, 62 bytes
lambda s:s[:eval('<='.join(map(str,map(cmp,s,s[1:]))))]==s[-1]

Takes input as a string and returns a Boolean.
Try it online!

Whoa, I've been hurting my head for hours and I couldn't even come up with something shorter than the combined byte count of your 2 solutions ! Cheers.

Ruby, 47 bytes
->n{(r=n.each_cons(2).map{|a,b|a<=>b})==r.sort}

Try it online!
Input as array of digits, output is boolean.

Japt, 11 bytes
Takes input as a digit array.
ä-
eUñg)«Ux

Try it or run all test cases
             :Implicit input of digit array U
ä-           :Deltas
\n           :Reassign to U
 Uñ          :Sort U
   g         :  By signs
e   )        :Check for equality with U
     «       :Logical AND with the negation of
      Ux     :U reduced by addition

Mathematica/Wolfram Language, 69 64 bytes
Pure function.  Takes input as an integer, returns True or False.
Sort[x=Sign@-Differences[y=IntegerDigits@#]]==x&&y[[1]]==Last@y&

Explanation:
The first clause checks the "hilliness":

IntegerDigits:  Get digits from integer.  Store in y.
-Differences: Take successive differences and flip signs.
Sign: Replace each entry with +1 if positive, 0 if zero, and -1 if negative.  Store in x.
Sort:  Sort list of +1, 0, -1 from smallest to largest.  Compare to original list in x.

The second clause checks whether the first and last digits are equal.
A tip of the hat to @IanMiller for tips on refining this code.

The fact that IntegerDigits and Differences are rather long function names is a bit annoying.

Can save 5 bytes with the following changes: Sort[x=Sign@-Differences[y=IntegerDigits@#]]==x&&y[[1]]==Last@y&

C# (Visual C# Interactive Compiler), 115 bytes
s=>!s.Where((c,i)=>i<1?c!=s[^1]:i>s.LastIndexOf(s.Max())?c>=s[i-1]:i>s.IndexOf(s.Max())?s.Max()!=c:c<=s[i-1]).Any()

Try it online!
Here is an overview of how this works...

Input is in the form of a string
Find the largest digit
Ensure the first and last digits are the same
Ensure digits after the last occurrence of the largest digit are decreasing
Ensure digits between the first and last occurrence of the largest digit are equal to the largest digit
Ensure digits before the first occurrence of the largest digit are increasing

Burlesque, 22 bytes
XXJl_-]==j2COqcm^mso&&

Try it online!
XX    # Explode into digits
J     # Duplicate
l_-]  # Head & Tail
==    # Are equal
j     # Reorder stack
2CO   # 2-grams
qcm^m # Compare with UFO operator
so    # If sorted
&&    # If going up then down AND head-tail is equal

Retina 0.8.2, 52 bytes
.
$*1;$&$*1,
(1+),\1
,
^(1+);(,1+;)*(,;)*(1+,;)*\1,$

Try it online! Link includes test cases. Explanation:
.
$*1;$&$*1,

Convert each digit to unary twice, separated by ;s and terminated by ,s. However, you can then think of the result as the first digit, a ;, then all the pairs of adjacent digits, the digits of each pair separated by , and the pairs separated by ;s, then another ;, then the last digit, then a final ,.
(1+),\1
,

Subtract the pairs of adjacent digits. This leaves ;,; for equal digits and 1s on the greater side for unequal digits. (This could be done as part of the following regex but obviously that wouldn't be so golfy.)
^(1+);(,1+;)*(,;)*(1+,;)*\1,$

Match the first digit, then any number of pairs of ascending digits, then any number of pairs of equal digits, then any number of pairs of descending digits, then match the first digit again at the very end.

Red, 181 bytes
func[n][m: last sort copy t: s: form n
parse t[opt[copy a to m(a: sort unique a)]copy b thru any m
opt[copy c to end(c: sort/reverse unique c)]](s = rejoin[a b c])and(s/1 = last s)]

Try it online!
More readable:
f: func[n][
    t: s: form n
    m: last sort copy t
    parse t [ opt [ copy a to m (a: sort unique a) ]
              copy b thru any m
              opt [ copy c to end (c: sort/reverse unique c) ]
            ]
    (s = rejoin [ a b c ]) and (s/1 = last s)
]

Powershell, 77 bytes
($x=-join("$($args|%{"-$_;$_"})"|iex))-match'^(-\d)+0*\d+$'-and$x[1]-eq$x[-1]

Less golfed test script:
$f = {
                                           # $args = 1,2,3,3,3,2,1
$a=$args|%{"-$_;$_"}                       # "-1;1","-2;2","-3;3","-3;3","-3;3","-2;2","-1;1"
$d="$a"                                    # "-1;1 -2;2 -3;3 -3;3 -3;3 -2;2 -1;1"
$x=-join($d|Invoke-Expression)             # "-1-1-100111"
$x-match'^(-\d)+0*\d+$'-and$x[1]-eq$x[-1]  # $true or $false

}

@(
    ,($True , 1,2,3,2,1 )
    ,($True , 1,2,3,3,3,2,1 )
    ,($True , 9,9 )
    ,($True , 3 )
    ,($True , 2,3,4,5,6,7,9,9,2 )
    ,($False, 1,2,3,2 )
    ,($False, 7,7,8,8,9,6 )
    ,($False, 2,3,2,3,2 )
    ,($False, 4,5,5,6,6,5,5,4 )
    ,($False, 5,6,4,5 )
) | % {
    $expected,$a = $_
    $result = &$f @a
    "$($result-eq$expected): $result"
}

Output:
True: True
True: True
True: True
True: True
True: True
True: False
True: False
True: False
True: False
True: False

Python 3, 114 bytes
def f(r):
 l=[*r]
 for i in-1,0:
  while 1<len(l)and l[i]<l[(1,-2)[i]]:l.pop(i)
 return 2>len({*l})and r[0]==r[-1]

Try it online!
Way longer than some Python 2 solutions, but this one is def-based and I like it.


text:
Compound interest with additions
You have been given the charge to calculate the current balance as of the day that you perform the calculation for 330,000 individuals who worked for an average of 30 years spanning 300 years where the initial principal was 1 with an addition of 1 per day and interest rate set at 3%.
You initially tried to use online compound interest with additions calculators to compute the sum. But all 10 calculators you tried had different results due to rounding errors. You decide to compose your own code which will assist in completing your charge.
Input
Your task is write a function f which takes as input

p Principal. A positive integer or decimal reflecting initial deposit.
r Rate. A positive decimal reflecting the annual interest rate.
t Time. An positive integer reflecting years to compute the compounding interest with additions.
n Periods. A positive integer reflecting the number of periods per year to compound interest.
a Addition. A positive integer or decimal which will be added to the current principal at the end of each period. Any number of additions can be deposited during t; for example, 10 additions of 20 can be deposited in a single day, or no deposits can be made during a period. For this question a will be a constant value, to avoid confusing users who expect output to be a single, consistent value.

Output
The output can be an array of \$n\$ arrays of numbers, where each element is [year, day, days, principal] as follows:

year The year as a positive integer within t years.
doy (day of year): The day number within a year; \$0 \le\$ day \$\le 360\$ e.g. days = 460 implies year = 2 and doy = 100$.
days The number of days since the initial deposit p was made.
balance The current balance.

Other acceptable output formats:

The above, but with elements of each array in a different (consistent) order;
List of comma or space-delimited strings;
The above, joined by newlines or tabs;
JSON string representation of an array of objects;
Spreadsheet;
Any other formats permitted by default.

Important

Interest is compounded at the end of each period, which produces a new principal beginning at the next period. The addition, if any, is added to the new principal after interest is applied at the end of the period.
"Leap day" and "leap years" are irrelevant to the question. The requirement for this question is to use the constant banker's year consisting of 360 days.

Example
Input
p=1,r=0.03,t=1,n=12,a=10

Output (truncated, see stacksnippet). You need not output the labels "year", "day", etc.
[
      {
        "year": 1,
        "doy": 0,
        "days": 0,
        "balance": 1,
        "rate": 0.03,
        "addition": 0
      },
      { "year": 1,
        "doy": 30,
        "days": 30,
        "balance": 11.0025,
        "rate": 0.03,
        "addition": 10
      },...
      {
        "year": 1,
        "doy": 180,
        "days": 180,
        "balance": 61.391346409181246,
        "rate": 0.03,
        "addition": 10
      },...
      {
        "year": 1,
        "doy": 360,
        "days": 360,
        "balance": 122.69424361094278,
        "rate": 0.03,
        "addition": 10
      }
]

[
  {
    "year": 1,
    "DOY": 0,
    "days": 0,
    "balance": 1,
    "rate": 0.03,
    "addition": 0
  },
  {
    "year": 1,
    "DOY": 30,
    "days": 30,
    "balance": 11.0025,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 60,
    "days": 60,
    "balance": 21.03000625,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 90,
    "days": 90,
    "balance": 31.082581265625,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 120,
    "days": 120,
    "balance": 41.160287718789064,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 150,
    "days": 150,
    "balance": 51.26318843808603,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 180,
    "days": 180,
    "balance": 61.391346409181246,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 210,
    "days": 210,
    "balance": 71.5448247752042,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 240,
    "days": 240,
    "balance": 81.72368683714221,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 270,
    "days": 270,
    "balance": 91.92799605423507,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 300,
    "days": 300,
    "balance": 102.15781604437065,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 330,
    "days": 330,
    "balance": 112.41321058448158,
    "rate": 0.03,
    "addition": 10
  },
  {
    "year": 1,
    "DOY": 360,
    "days": 360,
    "balance": 122.69424361094278,
    "rate": 0.03,
    "addition": 10
  }
]

Formula
You can use the formula at Saving and Investing

If D represents the amount of a regular deposit, r the annual
  interest rate expressed as a decimal, m the number of equal
  compounding period (in a year), and t time in years, then the
  future value, F, of the account, is:

or any comparable formula which determines a future value that you decide or is available at the language that you use, for example the formulas located at

Continually Compounded Interest + Addition to Principal
Compound Interest Formula adding annual contributions

Winning criteria
Shortest code in bytes.

Output format is a bit restrictive. What should we do in languages without objects?  Also, can we return a function f such that f(42,"year") displays the value of the "year" field in the 42nd object, and calling f on anything that's not not "year", "day", "days", "principal", "rate", or "addition" is undefined behavior?

@lirtosiast Does the language provide a means to out strings? If yes, then output can be JSON; see the question at "or JSON string". Not fully gathering the second sentence, as yet. The output should be the entire graph for the total duration of t, including an entry for every n.

This is oddly restrictive, and resembles some kind of homework problem to me. Was this sandboxed?

@Gigaflop What do you mean by "oddly restrictive"? Be specific. No, not "homework". No, not "sandboxed".

Is someone trying to get PP&CG to write their commercial finance code? I think we should be told.

@J.Doe Why do you suspect the question is not the truth? Have you actually tried to derive the result at the question following the suggestion to try 10 different online calculators with the input provided at the question? Have already achieved the requirement, thus the proof at the example at the question. If you determine that the results at the example at the question are not accurate, kindly state that so the algorithm can be corrected. The question is tagged code-golf.

@guest271314 By oddly restrictive, I mean that the output format seems to be very restrictive such that it might disqualify some of the most popular languages used. Furthermore, the information in the output could effectively be conveyed at each step rather than all at the end, and communicate the same information. I don't see any real reason for such an inflexible output format.

@Gigaflop This is not a popularity contest. If the language is "popular", in your view, it should have enough developers contributing to the code base to solve such a question. There is no difference between writing code that reproduces the entire graph and that outputs a single entry in the graph. The code must be capable of achieving the entire output, and demonstrate that.

With those types of comments you will only get downvotes... #justSaying

@LuisfelipeDejesusMunoz "With those types of comments you will only get downvotes... #justSaying" What are you talking about? Am not concerned with emotional responses to the question, or comments thereabout. The question does not ask for a group hug. Answer the coding question. Or not.

@guest271314, please leave your attitude at the door, take some time to learn what this site is about, listen to the advice being offered to you in order to help you improve your challenges and, above all, start using the Sandbox. All but one of your challenges have been poorly received and your continued response to those trying to help you out has been to resort to throwing insults around.

@Shaggy There have been no "attitude" or "insults" made by this user at all. If an individual interprets direct communication as such, that is their emotional issue and has absolutely nothing to do with the question or coding at all. Output can be in a wide range of options which are not complicated at all. Choose the language which produces output that meets the criteria at the question.

@guest271314 I don't object to your being direct nor do I downvote questions for that reason. Personally I think there is room on this site for well-written challenges targeted at certain classes of languages, even as the majority of questions on this site move away from it. However, there are strong consensus on meta that challenges should be written so that most languages can participate, that jumping through hoops to fit an output format removes fun, and that creators of a challenge should edit challenges to fit community guidelines. If you disagree, make a persuasive argument on meta.

@lirtosiast The output format is not restrictive, nor was it intended to be restrictive as part of the challenge. meta is a different domain altogether. Am not trying to convince any user of anything. How exactly is the string as JSON or array [{"year": 1,         "day": 0,         "days": 0,         "principal": 1,         "rate": 0.03,         "addition": 0}], or as a table, or as a spreadsheet, restrictive? Which languages are restricted from producing such output?

@lirtosiast Are any languages restricted from producing JSON?

@Gigaflop See updated question.

Can we output an array of arrays of just the values without the labels?

@Quintec Yes. Output formatting is not intended to be a restriction or challenge. We simply need to have uniform output; to be aware of what the values represent as to input at each answer.

@JoKing day is the day of a banker's year 360 which resets to 0 after each new t. days reflect the sum of all days, does not reset to 0 after each t. The example only demonstrates a single t, thus the update of days is not printed. days would be 361 at the start of t 2, day would be reset to 0.

@JoKing Yes, for uniformity. Ideally, although not specifically stated, the function should be able to be adjusted to handle more than one additions and no additions during a given period; omitted from the question to avoid confusion as to the requirement and verifying output. Variable additions and rates would perhaps add complexity to the question which would lead to users' not being clear as to what the expected output is.

Ideally? Is that part of the challenge?

@Quintec No. Users would invariably state that the question or output is not clear. Would have to test for each variation of possible addition and interest rate, which is exhaustive. However, we should have all of the relevant values on each line or element of array produced as a discrete unit; so that we know the extent of the dataset that we are examining. When rate or addition are omitted from a discrete output unit those variables are unknowns as to the remainder of the values without reverse engineering, and ultimately, guessing.

@JoKing An alternative would be to output rate and addition once at the first field of output, since we are only dealing with a single addition value per n and fixed rate per t at this question. Would that address the consideration of not repeating the code or output?

@JoKing Updated to remove requirement to output rate and addition.

"Accuracy must be to at least 14 decimal places". This is impossible using IEEE 754 double width numbers unless you add some tight constraints which ensure that the final value doesn't exceed about 10. If your intention is that all answers must use a type like Java's BigDecimal then you should make that explicit.

Is the addition of a before or after interest is calculated?

The section on output doesn't asks for an array of objects but doesn't say how many. Is it one for each period? What if the periods aren't an integral number of days (as very few are)? How are leap years handled? If the output is supposed to be for one year, why does it not end on year 2, day 0?

@PeterTaylor 1. Output at least up to 14 decimal places. One output for every period. A banker's year is 360 days, as stated in the question.

@Dennis What is not clear to you in the question?

@guest271314 https://codegolf.stackexchange.com/questions/176247/compound-interest-with-additions#comment424380_176247 is still not clarified for example. We understand that you're requiring that output must be at least accurate up to 14 decimal places, but your response didn't address the issue.

In case you don't understand IEEE 754 etc.: Built-in floating point type in most languages has only about 16 decimal digits of precision. If the integer part has more than ~3 digits then there are only <14 digits of precision for the fractional part, which may be impossible to represent some values. For example 1000000000.000000001 cannot be represented "accurate to 14 decimal places" using Javascript's default number type.

@user202729 The point is to produce output up to 14 decimal points - where possible - to evaluate how different languages or approaches to solving the question produce different results, see https://codegolf.stackexchange.com/questions/176247/compound-interest-with-additions#comment424359_176260 where the observation was noted, though does not make the answer or the result derived using JavaScript necessarily incorrect. https://www.mathsisfun.com/accuracy-precision.html.

@user202729 Is the only part of the question that is porportedly "unclear" to users the output? If that is the case what constructive suggestion do you have to resolve users' apparent confusion as to output? Or, is there another reason users voted to close the question as "unclear"? _"Bias (don't let precision fool you!)
When we measure something several times and all values are close, they may all be wrong if there is a "Bias"
Bias is a systematic (built-in) error which makes all measurements wrong by a certain amount."_ https://www.mathsisfun.com/accuracy-precision.html

@user202729 The question does not ask to produce the exact same output the BIS would produce for the same input. The question merely asks to produce the output using the language of the users' choice, golfed, up to a reasonable or possible decimal point where comparisons of the output can be made; given the fact that output from online calculators, including gov'ment calculators, is not consistent. Again, what is "unclear" in the text of the question, and what needs to be edited to make the question clear to those users who vote to close the question citing "unclear"?

@user202729 Updated question. Does that resolve that concern as to computation and output?

@PeterTaylor "Leap day" does not affect the question whatsoever. The contract at the question uses 360-day years exclusively. Updated the question as to decimal points. Do the edits clarify the question to you?

@PeterTaylor "..it depends on how the interest on your mortgage is calculated and whether it is done so on a 360- or 365-day year.
Most mortgages... accrue interest based on a monthly rate, which is calculated by simply dividing the annual rate by 12. That number is then multiplied by the loan balance to determine the monthly interest amount. Since it uses a generic month, or 1/12th of a year, it makes no difference is that month has 30 days, 31 days, 28 days or 29 days" https://www.thearamcogroup.com/Blog/bid/126773/Does-Leap-Day-Have-Any-Impact-On-A-Mortgage

Does "The principal must not be rounded" mean "must not be rounded to the nearest integer" or "must be exact"?

I raised six points. You have edited the question to fix the first one. That leaves five.

@lirtosiast The previous description asked for 14 decimal places. Must not be rounded means your code does not directly perform a mathematical operation to round the result. Output whatever your language outputs, following the formula at the question, or whatever formula you choose to use.

@PeterTaylor "Is the addition of a before or after interest is calculated?" is directly answered at the question by both a textual description and the formula used. The updated question resolves your other inquiries, as " If the output is supposed to be for one year, why does it not end on year 2, day 0?" is a nitpick that has no relevance to the question, correct? If not, kindly number what you mean by "six points".

"...directly answered at the question by both a textual description" where? "The updated question resolves your other inquiries" where? And when? The only update to the question changed "Accuracy must be to at least 14 decimal places." to "Include the decimal portion of the number, if any is produced by the language that you decide to use to compute the period, in the output.".

"a nitpick that has no relevance to the question, correct?" No. I want to know if answers are required to special-case the last entry.

@guest271314 Made some edits to the question. Change them again if they don't match your intention.

@lirtosiast Balance is the current principal when the computation is made. "DOY" should be lowercase, to match the other properties case?

@guest271314 I don't think case matters when no competitive answer will bother printing it anyway.

@PeterTaylor Your concerns are not clearly delineated as number 1-6. The decimal portion of question should be clear now. The "special case", as you refer to the 13 entries where interest is accrued for only 12 periods, at the example at the question, is to present the first entry in the output. Unless we can get the algorithm that the Bank for International Settlements uses, what algorithm do you suggest we rely on for the definitive formula to calculate compound interest with additions or contributions; that we will compare output to?

@lirtosiast Fair enough. Will re-read and point out to you any inconsistencies with the original stated requirement if found. If the question is now clear to you, perhaps the question will be clear to other users, or you can tell them directly why, in your view, the question is clear now.

@PeterTaylor You could consider the first entry the receipt or printout of the initial deposit. The "leap day" concerns have been addressed, above, correct? We are dealing with only 360 day years. And the question does not ask for defensive coding against bureaucracy  What is the significance of 1/1/1753 in SQL Server?. Does that make sense to you?

"Is the addition of a before or after interest is calculated?" This is still not addressed in the question or comments. 3 is addressed by lirtosiast's edit. 4. "What if the periods aren't an integral number of days (as very few are)?" is still not addressed in the question or comments. 5. "How are leap years handled?" is still not addressed in the question, which nowhere clearly explains the 360-day year mentioned in comments. 6. "If the output is supposed to be for one year, why does it not end on year 2, day 0?" is still not addressed adequately even in comments.

@PeterTaylor 2. The addition is added to the previously computed principal after interest applied. See the formula at the question. 4. Do not gather what you mean. 5. Leap years are irrelevant. The contract specifies 360 years at the question. 6. It does end at that point, if that is how you decide to view the output. The last entry is the complete 360 day year. Or, from your perspective, year 2, day 0.

Great. Now please edit the question to state that, because comments are temporary. 4. If there are 7 periods, how are the days rounded?

It doesn't. The only mention of 360 in the current version is "The day number within a year; 0≤ day ≤360 e.g. days = 465 implies year = 2 and DOY = 100" (so it seems that lirtosiast misunderstood you, because that implies 365 days per year). In the previous version the only mention was "Initially set to 360, a banker's year; this input must be capable of being adjusted to a different period, for example, 360/12 monthly, or 360/4, quarterly", which does not clearly say that all years have 360 days. 6. If year 1 has a day 0 and a day 360, it must have at least 361 days.

@PeterTaylor 2. There is no rounding. Will adjust question concerning "465"

@PeterTaylor Updated question

Haskell, 115 112 bytes
d=360
(r#t)n a=zipWith(\y x->(max(ceiling$y/d)1,until(<=d)(-d+)$y*d/n,y*d/n,x))[0..t*n].iterate(\x->x+(x*r)/n+a)

Function # takes the parameters in order r, t, n, a, p and returns a list of 4-tuples (year, day, days, principal).
Try it online!

Floating point numbers can be returned for day and days to save a few bytes. Does the program update days when t is 2?

@guest271314: See output for t=2, n=360:  Try it online!

Interesting. Got 3655.4199681711298 for day 360 here using JavaScript. The results at linked tio are 3655.419968171068

@guest271314: maybe my code is one of the many online compound interest services mentioned in the introduction of your challenge that accumulates rounding errors.