Skip to content

Commit 8156a51

Browse files
add Mailman easy solution
1 parent c3eac2b commit 8156a51

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

medium300/MailmanEasy.java

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package medium300;
2+
3+
public class MailmanEasy {
4+
public String totalHouses(int H, int W) {
5+
6+
long x = ((long) H * W);
7+
8+
if (H == 1 && W > 2 || W == 1 && H > 2)
9+
return "0";
10+
else if (H % 2 == 0 || W % 2 == 0)
11+
return String.valueOf(x);
12+
13+
return "0";
14+
15+
}
16+
}

0 commit comments

Comments
 (0)