FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaExercises/Experiments/CrazyTask.java at master · biblelamp/JavaExercises · GitHub
biblelamp
/
JavaExercises
Public
Notifications
You must be signed in to change notification settings
Fork
130
Star
153
Code
Issues
1
Pull requests
9
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaExercises
/
Experiments
/
CrazyTask.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (19 loc) · 608 Bytes
Breadcrumbs
JavaExercises
/
Experiments
/
CrazyTask.java
Copy path
File metadata and controls
21 lines (19 loc) · 608 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import
java
.
util
.*;
import
java
.
util
.
function
.*;
import
java
.
util
.
stream
.*;
class
CrazyTask
{
public
static
void
main
(
String
[]
args
) {
final
int
[]
counters
= {
0
};
List
<
Integer
>
source
=
Arrays
.
asList
(
0
,
0
,
1
,
0
,
1
);
Supplier
<
Stream
<
Integer
>>
bytes
= () ->
source
.
stream
()
.
filter
(
x
-> {
counters
[
0
]++;
return
x
>
0
;
});
if
(
bytes
.
get
().
findFirst
() ==
bytes
.
get
().
reduce
((
x
,
y
) ->
y
))
System
.
out
.
println
(
counters
[
0
]--);
else
System
.
out
.
println
(
counters
[
0
]++);
}
}
Back
|
FazBrowse Home
|
New Git URL