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

12
LINES

< > BotCompany Repo | #1012827 // longestString

JavaX fragment (include)

static S longestString(Collection<S> l) {
  S longest = null;
  int n = -1;
  if (l != null) for (S s : l) {
    int len = l(s);
    if (len > n) {
      n = len;
      longest = s;
    }
  }
  ret longest;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1012827
Snippet name: longestString
Eternal ID of this version: #1012827/3
Text MD5: 6d8f682dd014dc7b748aacf8e05e551d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-14 00:09:54
Source code size: 219 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 357 / 387
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000475 - Smart Bot's answer to: !fresh recentlyChangedSnippets()