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

7
LINES

< > BotCompany Repo | #1030165 // longestCommonPrefixOfCISetAndString

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

Transpiled version (2741L) is out of date.

// return longest common prefix of s an an entry of set
sS longestCommonPrefixOfCISetAndString(S s, NavigableSet<S> set) {
  if (set == null || s == null) null;
  S a = set.floor(s), b = set.higher(s);
  int n = Math.max(lCommonPrefixCI(a, s), lCommonPrefixCI(b, s));
  ret takeFirst_string(s, n);
}

Author comment

Began life as a copy of #1030164

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030165
Snippet name: longestCommonPrefixOfCISetAndString
Eternal ID of this version: #1030165/5
Text MD5: 69b54a5641bbf4ea81a35214580b8e17
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-12 10:50:00
Source code size: 305 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 290
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)