# Prime Dates

### Problem Statement :

```In this challenge, the task is to debug the existing code to successfully execute all provided test files.

Given two dates each in the format dd-mm-yyyy, you have to find the number of lucky dates between them (inclusive). To see if a date is lucky,

Firstly, sequentially concatinate the date, month and year, into a new integer  erasing the leading zeroes.
Now if x is divisible by either 4 or 7, then we call the date a lucky date.

For example, let's take the date "02-08-2024". After concatinating the day, month and year, we get x = 2082024. As x is divisible by 4 so the date "02-08-2024" is called a lucky date.

Debug the given function findPrimeDates and/or other lines of code, to find the correct lucky dates from the given input.

Note: You can modify at most five lines in the given code and you cannot add or remove lines to the code.

To restore the original code, click on the icon to the right of the language selector.

Input Format

Input Format

The only line of the input contains two strings u and v denoting the two dates following the format dd-mm-yyyy. Consider, d is the day number, m is the month number and y is the year number.

Note: Here  m = 01 means January, m = 02 means February,  m = 03 means March and so on and all the dates follow the standard structure of English calender including the leap year.

Constraints

1  <=  d1, d2  <= 31
1  <=  m1, m2  <= 12
1000  <=   y1, y2   <=  9999

Output Format

For each test cases, print a single integer the number of lucky dates between u and v in a single line.```

### Solution :

```                            ```Solution in C :

In   Python3  :

import re
month = []

def updateLeapYear(year):
if year % 400 == 0:
month = 29
elif year % 100 == 0:
month = 28
elif year % 4 == 0:
month = 29
else:
month = 28

def storeMonth():
month = 31
month = 28
month = 31
month = 30
month = 31
month = 30
month = 31
month = 31
month = 30
month = 31
month = 30
month = 31

def findPrimeDates(d1, m1, y1, d2, m2, y2):
storeMonth()
result = 0

while(True):
x = d1
x = x * 100 + m1
x = x * 10000 + y1
if x % 4 == 0 or x % 7 == 0:
result = result + 1
if d1 == d2 and m1 == m2 and y1 == y2:
break
updateLeapYear(y1)
d1 = d1 + 1
if d1 > month[m1]:
m1 = m1 + 1
d1 = 1
if m1 > 12:
y1 =  y1 + 1
m1 = 1
return result;

for i in range(1, 15):
month.append(31)

line = input()
date = re.split('-| ', line)
d1 = int(date)
m1 = int(date)
y1 = int(date)
d2 = int(date)
m2 = int(date)
y2 = int(date)

result = findPrimeDates(d1, m1, y1, d2, m2, y2)
print(result)```
```

## No Prefix Set

There is a given list of strings where each string contains only lowercase letters from a - j, inclusive. The set of strings is said to be a GOOD SET if no string is a prefix of another string. In this case, print GOOD SET. Otherwise, print BAD SET on the first line followed by the string being checked. Note If two strings are identical, they are prefixes of each other. Function Descriptio

## Cube Summation

You are given a 3-D Matrix in which each block contains 0 initially. The first block is defined by the coordinate (1,1,1) and the last block is defined by the coordinate (N,N,N). There are two types of queries. UPDATE x y z W updates the value of block (x,y,z) to W. QUERY x1 y1 z1 x2 y2 z2 calculates the sum of the value of blocks whose x coordinate is between x1 and x2 (inclusive), y coor

## Direct Connections

Enter-View ( EV ) is a linear, street-like country. By linear, we mean all the cities of the country are placed on a single straight line - the x -axis. Thus every city's position can be defined by a single coordinate, xi, the distance from the left borderline of the country. You can treat all cities as single points. Unfortunately, the dictator of telecommunication of EV (Mr. S. Treat Jr.) do

## Subsequence Weighting

A subsequence of a sequence is a sequence which is obtained by deleting zero or more elements from the sequence. You are given a sequence A in which every element is a pair of integers i.e A = [(a1, w1), (a2, w2),..., (aN, wN)]. For a subseqence B = [(b1, v1), (b2, v2), ...., (bM, vM)] of the given sequence : We call it increasing if for every i (1 <= i < M ) , bi < bi+1. Weight(B) =