Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1032499 // bestOfN

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Compilation Failed (4402L/25K).

static <A> Scored<A> lambdaMapLike bestOfN(IF1<A, Double> scoreFunction, int n, IF0<A> produce) {
  new Best<A> best;
  
  repeat n {
    A a = produce!;
    double score = scoreFunction.get(a);
    best.put(a, score);
  }
  
  ret best.scored();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032499
Snippet name: bestOfN
Eternal ID of this version: #1032499/2
Text MD5: fab9102d0360960640db5984b18c82f8
Transpilation MD5: cce0b79dfe706c6310befda383101320
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-10 18:17:36
Source code size: 258 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 173 / 233
Version history: 1 change(s)
Referenced in: [show references]