4 saved 1 byte
source | link

JavaScript (ES6), 9898 97 bytes

Saved 1 byte thanks to Neil

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a space-separated list of names such as Lisa Bob.

l=>h=>l.replace(/(\w+.* )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))
l => h =>                         // given a list of guests l and a party time h
  l.replace(                      // for each guest in l:
    /(\w+.* )(.*)\n/g,               //   extract the name a and arrival time b
    (_, a, b) =>                  //   subtract the arrival time from the time counter
      (t -= T(b)) < 0 ?           //   if the result is negative:
        a                         //     the guest is late: keep the name
      :                           //   else:
        '',                       //     the guest is on time: remove this entry
    t = (                         //   initialize the time counter t
      T = h =>                    //   define T():
        eval(                     //     a function that takes either a time
          h.replace(/:/, '*60+')  //     in hh:mm format or an amount of minutes
        )                         //     and returns an amount of minutes   
    )(h)                          //   call it with the party time
  )                               // end of replace()
let f =

l=>h=>l.replace(/(\w+.* )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))

JavaScript (ES6), 98 bytes

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a space-separated list of names such as Lisa Bob.

l=>h=>l.replace(/(\w+ )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))
l => h =>                         // given a list of guests l and a party time h
  l.replace(                      // for each guest in l:
    /(\w+ )(.*)\n/g,              //   extract the name a and arrival time b
    (_, a, b) =>                  //   subtract the arrival time from the time counter
      (t -= T(b)) < 0 ?           //   if the result is negative:
        a                         //     the guest is late: keep the name
      :                           //   else:
        '',                       //     the guest is on time: remove this entry
    t = (                         //   initialize the time counter t
      T = h =>                    //   define T():
        eval(                     //     a function that takes either a time
          h.replace(/:/, '*60+')  //     in hh:mm format or an amount of minutes
        )                         //     and returns an amount of minutes   
    )(h)                          //   call it with the party time
  )                               // end of replace()
let f =

l=>h=>l.replace(/(\w+ )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))

JavaScript (ES6), 98 97 bytes

Saved 1 byte thanks to Neil

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a space-separated list of names such as Lisa Bob.

l=>h=>l.replace(/(.* )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))
l => h =>                         // given a list of guests l and a party time h
  l.replace(                      // for each guest in l:
    /(.* )(.*)\n/g,               //   extract the name a and arrival time b
    (_, a, b) =>                  //   subtract the arrival time from the time counter
      (t -= T(b)) < 0 ?           //   if the result is negative:
        a                         //     the guest is late: keep the name
      :                           //   else:
        '',                       //     the guest is on time: remove this entry
    t = (                         //   initialize the time counter t
      T = h =>                    //   define T():
        eval(                     //     a function that takes either a time
          h.replace(/:/, '*60+')  //     in hh:mm format or an amount of minutes
        )                         //     and returns an amount of minutes   
    )(h)                          //   call it with the party time
  )                               // end of replace()
let f =

l=>h=>l.replace(/(.* )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))
3 added the commented version
source | link

Formatted and commented

l => h =>                         // given a list of guests l and a party time h
  l.replace(                      // for each guest in l:
    /(\w+ )(.*)\n/g,              //   extract the name a and arrival time b
    (_, a, b) =>                  //   subtract the arrival time from the time counter
      (t -= T(b)) < 0 ?           //   if the result is negative:
        a                         //     the guest is late: keep the name
      :                           //   else:
        '',                       //     the guest is on time: remove this entry
    t = (                         //   initialize the time counter t
      T = h =>                    //   define T():
        eval(                     //     a function that takes either a time
          h.replace(/:/, '*60+')  //     in hh:mm format or an amount of minutes
        )                         //     and returns an amount of minutes   
    )(h)                          //   call it with the party time
  )                               // end of replace()

Demo

Demo

Formatted and commented

l => h =>                         // given a list of guests l and a party time h
  l.replace(                      // for each guest in l:
    /(\w+ )(.*)\n/g,              //   extract the name a and arrival time b
    (_, a, b) =>                  //   subtract the arrival time from the time counter
      (t -= T(b)) < 0 ?           //   if the result is negative:
        a                         //     the guest is late: keep the name
      :                           //   else:
        '',                       //     the guest is on time: remove this entry
    t = (                         //   initialize the time counter t
      T = h =>                    //   define T():
        eval(                     //     a function that takes either a time
          h.replace(/:/, '*60+')  //     in hh:mm format or an amount of minutes
        )                         //     and returns an amount of minutes   
    )(h)                          //   call it with the party time
  )                               // end of replace()

Demo

2 minor update
source | link

JavaScript (ES6), 98 bytes

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a concatenatedspace-separated list of names such as LisaBobLisa Bob.

l=>h=>l.replace(/(\w+) )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

Demo

let f =

l=>h=>l.replace(/(\w+) )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))

JavaScript (ES6), 98 bytes

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a concatenated list of names such as LisaBob.

l=>h=>l.replace(/(\w+) (.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

Demo

let f =

l=>h=>l.replace(/(\w+) (.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))

JavaScript (ES6), 98 bytes

Takes the list of guests l and the party time h in currying syntax (l)(h). Expects a trailing linebreak on the list. Returns a space-separated list of names such as Lisa Bob.

l=>h=>l.replace(/(\w+ )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

Demo

let f =

l=>h=>l.replace(/(\w+ )(.*)\n/g,(_,a,b)=>(t-=T(b))<0?a:'',t=(T=h=>eval(h.replace(/:/,'*60+')))(h))

console.log(f(`Kevin 13:02
Ruby 5
Sam 3
Lisa 6
Bob 12
`)('13:15'))

1
source | link