Skip to content

Commit 734a115

Browse files
committed
new commits
1 parent f189451 commit 734a115

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

Python/Sales by Match.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
The second line contains space-separated integers describing the colors of the socks in the pile.
1717
1818
Constraints
19-
20-
where
2119
Output Format
2220
2321
Return the total number of matching pairs of socks that Alex can sell.
@@ -35,17 +33,7 @@
3533
3634
Alex can match three pairs of socks'''
3735

38-
39-
40-
#!/bin/python3
41-
42-
import math
43-
import os
44-
import random
45-
import re
46-
import sys
47-
48-
# Complete the sockMerchant function below.
36+
#solution
4937
def sockMerchant(n, ar):
5038
return sum([ar.count(i)//2 for i in set(ar)])
5139

Python/Write_a_function.py.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636
1990 is not a multiple of 4 hence it's not a leap year.'''
3737

3838
def is_leap(year):
39-
return year % 4 == 0 and (year % 400 == 0 or year % 100 != 0)
40-
41-
# Write your logic here
42-
43-
return leap
44-
45-
year = int(raw_input())
46-
print is_leap(year)
39+
leapyear = False
40+
if (((year%4==0 and year%100!=0) or year%400==0) and year>=1900):
41+
leapyear=True
42+
return leapyear
43+
44+
year = int(input())
45+
print(is_leap(year))

0 commit comments

Comments
 (0)