Dr. Zora built an algorithm to set the destructive or danger year,  his algorithm contains a pattern of years which were set by Hydra for attacks. As the Avengers needs to be ready mentally as well as physically. Agent Natalia Romanoff is assigned the task to detect the pattern of the selection of destruction year, and help Avengers. Agent Romanoff observes from the past details that, year ........,1824, 1842, 1848, 1860........, 1912, 1918, ......2012 were Destructive Years. Now observing the pattern Agent Romanoff needs to design an algorithm to determine future Destructive Years. Help her!    
Example 1:
Input: Year = 1848 
Output: "Destructive Year" 
Explanation:  According to agent Romanoff
Year 1848 is Destructive.
Example 2:
Input: Year = 1973
Output: "Non-Destructive Year"
Explanation: According to agent Romanoff
Year 1973 is Non-Destructive. 
Your Task:  
You dont need to read input or print anything. Complete the function isDestructive() which takes year as input parameter and returns that its Destructive or Non-Destructive.
Expected Time Complexity: O(logn)
Expected Auxiliary Space: O(1)
Constraints:
200<= year <=9999

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3
class Solution:
    def isDestructive (self, year):
        # code here 

Solutions:
class Solution:

	def isDestructive(self, year):
		y = str(year)
		s = 0
		for i in y:
			s += int(i)
		year = year % 100
		if s % 2 != 0 and year % 6 == 0:
			return 'Destructive Year'
		else:
			return 'Non-Destructive Year'


class Solution:

	def isDestructive(self, year):
		sums = 0
		last = year % 100
		while year > 0:
			sums += year % 10
			year = year // 10
		if sums % 2 != 0 and last % 6 == 0:
			return 'Destructive Year'
		return 'Non-Destructive Year'


class Solution:

	def isDestructive(self, year):
		ye = year
		rem = 0
		summ = 0
		while ye != 0:
			rem = ye % 10
			summ += rem
			ye = ye // 10
		last = year % 100
		if summ % 2 != 0 and last % 6 == 0:
			return 'Destructive Year'
		else:
			return 'Non-Destructive Year'