Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation. 

### Examples
```
"1999" --> "20th"
"2011" --> "21st"
"2154" --> "22nd"
"2259" --> "23rd"
"1124" --> "12th"
"2000" --> "20th"
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Starter code: def what_century(year):
	

Solutions:
def what_century(year):
	n = (int(year) - 1) // 100 + 1
	return str(n) + ('th' if n < 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(n % 10, 'th'))


def what_century(year):
	year = str(year)
	st = year[:2]
	st = int(st)
	gt = st + 1
	gt = str(gt)
	if year != '0000' and year[1:] != '000' and (year[2:] != '00'):
		if len(gt) == 2:
			if gt[0] == '1' and gt[1] == '0':
				return '10th'
			elif gt[0] == '1' and gt[1] in range(1, 10):
				return f'{gt}th'
			elif gt[0] != '1' and gt[1] == '0':
				return f'{gt}th'
			elif gt[0] != '1' and gt[1] == '1':
				return f'{gt}st'
			elif gt[0] != '1' and gt[1] == '2':
				return f'{gt}nd'
			elif gt[0] != '1' and gt[1] == '3':
				return f'{gt}rd'
			else:
				return f'{gt}th'
		elif gt[0] == 1:
			return '1st'
		elif gt[0] == 2:
			return '2nd'
		elif gt[0] == 3:
			return '3rd'
		else:
			return f'{gt}th'
	elif year[1:] == '000' and year != '0000':
		return f'{year[0]}0th'
	elif year[2:] == '00' and year[1:] != '000' and (year != '0000'):
		if year[1] == '1':
			return f'{year[:2]}st'
		elif year[2] == '2':
			return f'{year[:2]}nd'
		elif year[2] == '3':
			return f'{year[:2]}rd'
		else:
			return f'{year[:2]}th'
	elif year == '0000':
		return '0th'


def what_century(year):
	if 100 >= int(year) > 0:
		return '1st'
	if 200 >= int(year) > 100:
		return '2nd'
	if 300 >= int(year) > 200:
		return '3rd'
	if 400 >= int(year) > 300:
		return '4th'
	if 500 >= int(year) > 400:
		return '5th'
	if 600 >= int(year) > 500:
		return '6th'
	if 700 >= int(year) > 600:
		return '7th'
	if 800 >= int(year) > 700:
		return '8th'
	if 900 >= int(year) > 800:
		return '9th'
	if 1000 >= int(year) > 900:
		return '10th'
	if 1100 >= int(year) > 1000:
		return '11th'
	if 1200 >= int(year) > 1100:
		return '12th'
	if 1300 >= int(year) > 1200:
		return '13th'
	if 1400 >= int(year) > 1300:
		return '14th'
	if 1500 >= int(year) > 1400:
		return '15th'
	if 1600 >= int(year) > 1500:
		return '16th'
	if 1700 >= int(year) > 1600:
		return '17th'
	if 1800 >= int(year) > 1700:
		return '18th'
	if 1900 >= int(year) > 1800:
		return '19th'
	if 2000 >= int(year) > 1900:
		return '20th'
	if 2100 >= int(year) > 2000:
		return '21st'
	if 2200 >= int(year) > 2100:
		return '22nd'
	if 2300 >= int(year) > 2200:
		return '23rd'
	if 2400 >= int(year) > 2300:
		return '24th'
	if 2500 >= int(year) > 2400:
		return '25th'
	if 2600 >= int(year) > 2500:
		return '26th'
	if 2700 >= int(year) > 2600:
		return '27th'
	if 2800 >= int(year) > 2700:
		return '28th'
	if 2900 >= int(year) > 2800:
		return '29th'
	if 3000 >= int(year) > 2900:
		return '30th'
	if 3100 >= int(year) > 3000:
		return '31st'
	if 3200 >= int(year) > 3100:
		return '32nd'
	if 3300 >= int(year) > 3200:
		return '33rd'
	if 3400 >= int(year) > 3300:
		return '34th'
	if 3500 >= int(year) > 3400:
		return '35th'
	if 3600 >= int(year) > 3500:
		return '36th'
	if 3700 >= int(year) > 3600:
		return '37th'
	if 3800 >= int(year) > 3700:
		return '38th'
	if 3900 >= int(year) > 3800:
		return '39th'
	if 4000 >= int(year) > 3900:
		return '40th'
	if 4100 >= int(year) > 4000:
		return '41st'
	if 4200 >= int(year) > 4100:
		return '42nd'
	if 4300 >= int(year) > 4200:
		return '43rd'
	if 4400 >= int(year) > 4300:
		return '44th'
	if 4500 >= int(year) > 4400:
		return '45th'
	if 4600 >= int(year) > 4500:
		return '46th'
	if 4700 >= int(year) > 4600:
		return '47th'
	if 4800 >= int(year) > 4700:
		return '48th'
	if 4900 >= int(year) > 4800:
		return '49th'
	if 5000 >= int(year) > 4900:
		return '50th'
	if 5100 >= int(year) > 5000:
		return '51st'
	if 5200 >= int(year) > 5100:
		return '52nd'
	if 5300 >= int(year) > 5200:
		return '53rd'
	if 5400 >= int(year) > 5300:
		return '54th'
	if 5500 >= int(year) > 5400:
		return '55th'
	if 5600 >= int(year) > 5500:
		return '56th'
	if 5700 >= int(year) > 5600:
		return '57th'
	if 5800 >= int(year) > 5700:
		return '58th'
	if 5900 >= int(year) > 5800:
		return '59th'
	if 6000 >= int(year) > 5900:
		return '60th'
	if 6100 >= int(year) > 6000:
		return '61st'
	if 6200 >= int(year) > 6100:
		return '62nd'
	if 6300 >= int(year) > 6200:
		return '63rd'
	if 6400 >= int(year) > 6300:
		return '64th'
	if 6500 >= int(year) > 6400:
		return '65th'
	if 6600 >= int(year) > 6500:
		return '66th'
	if 6700 >= int(year) > 6600:
		return '67th'
	if 6800 >= int(year) > 6700:
		return '68th'
	if 6900 >= int(year) > 6800:
		return '69th'
	if 7000 >= int(year) > 6900:
		return '70th'
	if 7100 >= int(year) > 7000:
		return '71st'
	if 7200 >= int(year) > 7100:
		return '72nd'
	if 7300 >= int(year) > 7200:
		return '73rd'
	if 7400 >= int(year) > 7300:
		return '74th'
	if 7500 >= int(year) > 7400:
		return '75th'
	if 7600 >= int(year) > 7500:
		return '76th'
	if 7700 >= int(year) > 7600:
		return '77th'
	if 7800 >= int(year) > 7700:
		return '78th'
	if 7900 >= int(year) > 7800:
		return '79th'
	if 8000 >= int(year) > 7900:
		return '80th'
	if 8100 >= int(year) > 8000:
		return '81st'
	if 8200 >= int(year) > 8100:
		return '82nd'
	if 8300 >= int(year) > 8200:
		return '83rd'
	if 8400 >= int(year) > 8300:
		return '84th'
	if 8500 >= int(year) > 8400:
		return '85th'
	if 8600 >= int(year) > 8500:
		return '86th'
	if 8700 >= int(year) > 8600:
		return '87th'
	if 8800 >= int(year) > 8700:
		return '88th'
	if 8900 >= int(year) > 8800:
		return '89th'
	if 9000 >= int(year) > 8900:
		return '90th'
	if 9100 >= int(year) > 9000:
		return '91st'
	if 9200 >= int(year) > 9100:
		return '92nd'
	if 9300 >= int(year) > 9200:
		return '93rd'
	if 9400 >= int(year) > 9300:
		return '94th'
	if 9500 >= int(year) > 9400:
		return '95th'
	if 9600 >= int(year) > 9500:
		return '96th'
	if 9700 >= int(year) > 9600:
		return '97th'
	if 9800 >= int(year) > 9700:
		return '98th'
	if 9900 >= int(year) > 9800:
		return '99th'
	if 10000 >= int(year) > 9900:
		return '100th'


def what_century(year):
	ordinal = lambda n: '%d%s' % (n, 'tsnrhtdd'[(n // 10 % 10 != 1) * (n % 10 < 4) * n % 10::4])
	return ordinal((int(year) - 1) // 100 + 1)


def what_century(year):
	if year[2:] == '00':
		century = year[:2]
	else:
		century = str(int(year) // 100 + 1)
	suffix = 'th'
	if century[0] == '1':
		pass
	elif century[1] == '1':
		suffix = 'st'
	elif century[1] == '2':
		suffix = 'nd'
	elif century[1] == '3':
		suffix = 'rd'
	return century + suffix


def what_century(year):
	y = int(year)
	(c, r) = divmod(y, 100)
	if r:
		c += 1
	ones = c % 10
	tens = c // 10 % 10
	if tens == 1:
		suffix = 'th'
	elif ones == 1:
		suffix = 'st'
	elif ones == 2:
		suffix = 'nd'
	elif ones == 3:
		suffix = 'rd'
	else:
		suffix = 'th'
	return str(c) + suffix


SUFFIX_ONE = 'st'
SUFFIX_TWO = 'nd'
SUFFIX_THREE = 'rd'
SUFFIX_OTHER = 'th'

def what_century(year):
	century = 1 + (int(year) - 1) // 100
	return str(century) + ordinal_suffix(century)

def ordinal_suffix(number):
	if number // 10 == 1:
		return SUFFIX_OTHER
	elif number % 10 == 1:
		return SUFFIX_ONE
	elif number % 10 == 2:
		return SUFFIX_TWO
	elif number % 10 == 3:
		return SUFFIX_THREE
	else:
		return SUFFIX_OTHER


def what_century(year):
	year = int(year)
	output_century = year // 100
	ordinal = ''
	if year % 100 > 0:
		output_century += 1
	if output_century > 10 and output_century < 14:
		ordinal = 'th'
	elif output_century % 10 == 1:
		ordinal = 'st'
	elif output_century % 10 == 2:
		ordinal = 'nd'
	elif output_century % 10 == 3:
		ordinal = 'rd'
	else:
		ordinal = 'th'
	return str(output_century) + ordinal