You will be given a definition of a task first, then an example. Follow the example to solve a new instance of the task.
In this task, you are given a date in "dd/mm/yyyy" format. You need to check if the date is valid or not. Return 1 if it is valid, else return 0. A date is valid if the components day("dd"), month("mm") and year("yyyy") are all valid individually. A day(dd) is valid if it: a) lies between 1 and 31 for the months of January, March, May, July, August, October, December, b) lies between 1 and 28 for February on non-leap years and between 1-29 on leap years, c) lies between 1-30 for all other months. A month(mm) is valid if it lies in the range from 1 to 12 as there are 12 months in a year. A year is always valid if it is expressed in the form of "yyyy".

15/2/2014
Solution: 1
Why? It is a valid date as the month is February and it is not a leap year, so the range of days is from 1 to 28, and 15 lies in this range.

New input: 15/18/1730
Solution:
0