Transpiled version (2740L) is out of date.
1 | // return longest common prefix of s an an entry of set |
2 | sS longestCommonPrefixOfNavigableSetAndString(S s, NavigableSet<S> set) {
|
3 | if (set == null || s == null) null; |
4 | S a = set.floor(s), b = set.higher(s); |
5 | int n1 = lCommonPrefix(a, s), n2 = lCommonPrefix(b, s); |
6 | ifdef longestCommonPrefixOfNavigableSetAndString_debug |
7 | printVars_str("longestCommonPrefixOfNavigableSetAndString", +s, +set, +n1, +n2);
|
8 | endifdef |
9 | int n = Math.max(n1, n2); |
10 | ret takeFirst_string(s, n); |
11 | } |
Began life as a copy of #1029748
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1030164 |
| Snippet name: | longestCommonPrefixOfNavigableSetAndString [OK] |
| Eternal ID of this version: | #1030164/8 |
| Text MD5: | d591ee2215834ceee19b62d3d350b09a |
| 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:13 |
| Source code size: | 489 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 429 / 581 |
| Version history: | 7 change(s) |
| Referenced in: | [show references] |