[Question]
  [
# How long's left?
Recently, I was making pizza using a 5-minute timer on my phone. When someone walked in and asked me how long was left, I was confused for a moment at first as to how to answer the question. You see, if the timer at the current moment was at 3:47, by the time I had read out 'Three minutes and forty seven seconds' aloud, the time would have changed. Therefore, I need to find a time that the timer would reach *just* as I finish reading it out.
This is your challenge: to automate this process. Given a time in any appropriate format (":" delimited, or as a minute and second argument), output the earliest time from that current moment which would take an equal amount of time to read out as it would take for the timer to get to. We're assuming that each syllable takes 1 second to read out.
## Further rules
* You must count 'minutes' and 'seconds' as two of the syllables each, as well as an 'and' between them.
* The pizza will never take more than 59:59 to cook.
* '11 minutes and 0 seconds' is not 10 syllables: you must simplify to '11 minutes' (i.e 5 syllables). Same goes with minutes: '0 minutes and 7 seconds' is also only counted as 4 syllables.
* Your program can give the output in any format: an array of `[minutes, seconds]`, or even as `<minutes> minutes and <seconds> seconds` (normal text written out).
* Standard loopholes apply.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
# Test cases
All inputs as `(minutes, seconds)`
```
(4, 47) = (4, 38) (Four MiNutes And ThirTy Eight SeConds - 9 syllables/seconds)
(1, 1) = (0, 56) (FifTy-Six SeConds - 5 syllables/seconds)
(59, 57) = (59, 46) (FifTy Nine Minutes And Forty Six SeConds - 11 syllables/seconds)
(0, 10) = null/error/0 (no positive answer)
```
# Syllable count reference
For reference, here are the number of syllables in each number up to 59.
```
0,0 (does not need to be counted)
1,1
2,1
3,1
4,1
5,1
6,1
7,2
8,1
9,1
10,1
11,3
12,1
13,2
14,2
15,2
16,2
17,3
18,2
19,2
20,2
21,3
22,3
23,3
24,3
25,3
26,3
27,4
28,3
29,3
30,2
31,3
32,3
33,3
34,3
35,3
36,3
37,4
38,3
39,3
40,2
41,3
42,3
43,3
44,3
45,3
46,3
47,4
48,3
49,3
50,2
51,3
52,3
53,3
54,3
55,3
56,3
57,4
58,3
59,3
```
  
[Answer]
# JavaScript (ES6), ~~112 106~~ 105 bytes
*A shorter version based on a suggestion by @EmbodimentofIgnorance  
6 more bytes saved by @DaniilTutubalin*
Takes input as `(minutes)(seconds)`. Returns `[minutes, seconds]` or \$0\$ if there's no solution.
```
m=>d=F=s=>m|s?(g=n=>n&&(n%10!=7)-7+(n-11?n<13?2:n<21|n%10<1:0))(m)+g(s)^~d?F(s?s-1:m--&&59,d=-~d):[m,s]:0
```
[Try it online!](https://tio.run/##bcpLDoIwFIXhubtwYHNvoKZFCKHh0hmbMJoQCkRDW2ONI8LWEYc@kjP6zn9tnk1o75fbgztvuqWnxVJlqKZAlZ2ChoEcVY4xcDsptpQjzyNwXErtSnnQiXJlIqf3WUolEMFiNEDA82x0DUEHLpXlnLGsiA3x2aA62jiclFha74Ifu/3oB@ghRUhzxM2nSlz3jVmBkP22Ym3FX/2Ha7m8AA "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), ~~126~~ 119 bytes
Takes input as `(minutes)(seconds)`. Returns `[minutes, seconds]` or \$0\$ if there's no solution.
```
m=>d=F=s=>m|s?(g=n=>n&&2+(30774612>>2*n%(n>12?20:26)&3)+(n>12)+(n>19))(m)+g(s)+!!(m*s)^d?F(s?s-1:m--&&59,d=-~d):[m,s]:0
```
[Try it online!](https://tio.run/##bcrPCoJAEMfxe2/hoWVG3VjXfyjsevMlokBclcJdo4lO0aub1KkSBn7Mh@@5uTfUXk@XG3eT6eZezVZpo2pFStsHVTAop7RjTAYQizxPskhqLX23BacjWUlRygxZjMH7/0yBCBaDAQgDzwPrEx5NVQNVxKPScs5YWoRG8afBcm9DOpRibidH09jtxmmAHhKEJEfcfGuEy/1iWiCk/61YWrGqa7iU8ws "JavaScript (Node.js) – Try It Online")
### Commented
```
m =>                  // m = minutes
d =                   // d = delta in seconds between the initial time and the current time,
                      //     initialized to a non-numeric value (zero-ish)
F = s =>              // F is a recursive function taking s = seconds
  m | s ? (           // if either m or s is not 0:
    g = n =>          //   g is a helper function taking an integer n in [0..59]
      n &&            //     return 0 if n = 0
      2 + (           //     otherwise, start with 2 for either 'mi-nutes' or 'se-conds'
        30774612 >>   //     add the base number of syllables (0 to 3) corresponding to n
        2 * n %       //     using a bitmask of 13 entries x 2-bit:
                      //       12 11 10  9  8  7  6  5  4  3  2  1  0
                      //       01 11 01 01 01 10 01 01 01 01 01 01 00
        (n > 12 ? 20  //     using n MOD 10 if n is greater than 12
                : 26) //     or just n otherwise
        & 3           //     isolate the two least significant bits
      ) +             //   
      (n > 12) +      //     add 1 syllable for '-teen' or '-ty' if n is greater than 12
      (n > 19)        //     add 1 more syllable for 'x-ty' if n is greater than 19
  )(m) +              //   invoke g for the minutes
  g(s) +              //   invoke g for the seconds
  !!(m * s)           //   add 1 syllable for 'and' if both m and s are non-zero
  ^ d ?               //   if the result is not equal to the delta:
    F(                //     otherwise, do a recursive call:
      s ? s - 1       //       decrement s if it's not 0,
        : m-- && 59,  //       or decrement m and restart with s = 59
      d = -~d         //       increment the delta
    )                 //     end of recursive call
  :                   //   else:
    [m, s]            //     success: return [m, s]
:                     // else:
  0                   //   failure: return 0
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~287~~ 285 bytes
```
m=int(input())
s=int(input())
y=lambda w:3+(w[-1]=='7')-(w[-1]=='0')-(w[0]in'01')*(1+(w[0]=='0'))+(w=='11')-(w=='12')
z=lambda m,s:(2+y(f'{m:02d}'))*(m!=0)+(2+y(f'{s:02d}'))*(s!=0)+(m!=0!=s)
q=lambda t: (m-(t+60-s-1)//60,(s-t)%60)
print([q(t) for t in range(s+60*m) if z(*q(t))==t][0])
```
[Try it online!](https://tio.run/##VY/BqsIwEEX3/Yq4kMy0BpOKFQP5EumiD60GTKzNiFTx22tqn4q7OZx7L0zT0eHkF33vjPUE1jcXAsQk/GJnjpX721bsqhcZXDdClcbwFUfxATmCLK3nUnFMQWUvHh1GiJdSr9hw5RyT23vXzYKGPOug5nenZb59xEoKbmJkbP6L8BVhFIOfmIDJ@T1EmoETQFkhRRAK5/NCziAIwmkhMWna4a/NGQhZfWoZMetZW/n9DkKspA6ZrdkN0iGBxlAZP8C@X671cvUE "Python 3 – Try It Online")
It's not a very clever solution - it's mostly striaghtforward. Takes ~~'m:s'~~ **m and s as separate inputs** ~~(doesn't need to be padded),~~ and outputs (m,s). Throws an error if there's no valid output.
The program relies heavily on implicitly casting booleans to 0 and 1. The first line takes input. The second line defines a lambda function y which gives the syllables in a number - it assumes a base of 3 syllables, then adds 1 if it ends in 7, subtracts 1 if it ends in 0, and subtracts 1 if it's in the 10's and 2 if it's in the single digits. Twelve and eleven are manually adjusted at the end. The third line is a lambda for the syllables in the whole expression. Finally, fourth line gives the time after t seconds. Fifth line is the output - it builds an array of all the times that satisfy the problem, and outputs the first one.
**EDIT 1:** Thanks to Matthew Anderson in the comments, 2 bytes were shaved off by taking the inputs separately.
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 141 bytes
```
a=>b=>((a=Enumerable.Range(1,b+=a*60).Last(i=>new[]{i/60,i%60}.Sum(x=>x<1?0:(x%10==7?4:3)+(x==11?3:x<13?1:x<21|x%10<1?2:3))-1==b-i))/60,a%60)
```
[Try it online!](https://tio.run/##XY5NawIxEIbPm18RBCFT4zbxk6qzeyj2JBS2hx7Ew@wSa6CmsBtbi/W3bxOlLfSQzMs7Dw9TNf2qse3DwVUL67z8DSJ@4UGWbbElzErMhCBcusPe1FS@mrQg92KElmUP6WaiIF1R44XFzJmP9eZkbydK2u5EndOnw14cMTsudK5m4tjVCnGaj2ZD6IUetc6Hs7Ac5jqMgf6KRGAHAYC@Riz7FiDqKOignbN4Had4Hy9hveHeNP6eGtNw5CeWiJHkoynIkLTk@hLGd5KPr50KnfpJY2DnOdu@1YaqnXin@iLj1v1JgSW@/ozi5Lm23qysM2Ir4j4luM4SYM6SM0sq8tXuH9tZFsVj0bkQ7Tc "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 46 bytes
```
ḅḶbɗ60Ṛµ“÷ṢḣxE⁻Ṇ⁹ƬƝwɼỤṡl’ḃ4+2;0⁸ịS+ṬS$’)=JTị⁸Ḣ
```
[Try it online!](https://tio.run/##y0rNyan8///hjtaHO7YlnZxuZvBw56xDWx81zDm8/eHORQ93LK5wfdS4@@HOtkeNO4@tOTa3/OSeh7uXPNy5MOdRw8yHO5pNtI2sDR417ni4uztY@@HONcEqQHFNW68QoABIeMei/zqH249OerhzxqOmNVlAgxV07RQeNczlOtwOFIhEs/rINNvD7bWHluofawdqfbhz1f9ormgTHRPzWB2uaEMdQxBlaqljCuYb6BgagGgTHeNYrlgA "Jelly – Try It Online")
A monadic link taking as its argument the time as `[minutes, seconds]` and returning the appropriate time to say as `[minutes, seconds]` or `[seconds]` if less than a minute.
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 102 bytes
```
60:X;q~\X*+:W_{;(__X%\X/{_196656821516111872\_A%K+e<_{(2*m>3&3.5+}{\;}?@}2*+i+\X*+_W=!2$0<-}g;_X%\X/S@
```
[Try it online!](https://tio.run/##S85KzP3/38zAKsK6sC4mQkvbKjy@2lojPj5CNSZCvzre0NLMzNTMwsjQ1NDM0NDQwtwoJt5R1Vs71Sa@WsNIK9fOWM1Yz1S7tjrGutbeodZISztTG2RMfLitopGKgY1ubbo1xKxgh///TS0VTC0B "CJam – Try It Online")
Just a boring old magic-number binary look-up-table, nothing to see here.
]