Given 3 numbers A, B and C. Find the greatest number among them.
Example 1:
Input: A = 10, B = 3, C = 2
Output: 10
Explanation:
10 is the greatest among the three.
Example 2:
Input: A = -4, B = -3, C = -2
Output: -2
Explanation:
-2 is the greatest among the three.
Your Task:
You don't need to read input or print anything.Your task is to complete the function greatestOfThree() which takes three numbers A,B and C as input parameters and returns the greatest among them.
Expected Time Complexity:O(1)
Expected Auxillary Space:O(1)
Constraints:
-10^{9}<=A,B,C<=10^{9}

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3

class Solution:
    def greatestOfThree(self,A,B,C):
        #code here

Solutions:
class Solution:

	def greatestOfThree(self, A, B, C):
		m = max(A, B, C)
		return m


class Solution:

	def greatestOfThree(self, A, B, C):
		if A > B and A > C:
			return A
		elif B > C:
			return B
		else:
			return C


class Solution:

	def greatestOfThree(self, A, B, C):
		max_two = max(A, B)
		max_three = max(max_two, C)
		return max_three


class Solution:

	def greatestOfThree(self, A, B, C):
		lst = [A, B, C]
		return max(lst)


class Solution:

	def greatestOfThree(self, A, B, C):
		maxi1 = max(A, B, C)
		return maxi1


class Solution:

	def greatestOfThree(self, A, B, C):
		x = max(A, B, C)
		return x


class Solution:

	def greatestOfThree(self, A, B, C):
		if A > B:
			if A > C:
				return A
			return C
		else:
			if B > C:
				return B
			return C


class Solution:

	def greatestOfThree(self, A, B, C):
		if B < A > C:
			return A
		elif B > C:
			return B
		return C


class Solution:

	def greatestOfThree(self, A, B, C):
		li = []
		li.append(A)
		li.append(B)
		li.append(C)
		return max(li)


class Solution:

	def greatestOfThree(self, A, B, C):
		l = max(A, B, C)
		return l


class Solution:

	def greatestOfThree(self, A, B, C):
		if A > B and A > C:
			return A
		if B > A and B > C:
			return B
		if C > A and C > B:
			return C


class Solution:

	def greatestOfThree(self, A, B, C):
		D = max(A, B)
		return max(D, C)


class Solution:

	def greatestOfThree(self, A, B, C):
		p = max(A, B)
		ans = max(p, C)
		return ans


class Solution:

	def greatestOfThree(self, A, B, C):
		list = [A, B, C]
		return max(list)


class Solution:

	def greatestOfThree(self, a, b, c):
		if a > b and a > c:
			return a
		elif b > c:
			return b
		else:
			return c


class Solution:

	def greatestOfThree(self, A, B, C):
		a = [A, B, C]
		return max(a)


class Solution:

	def greatestOfThree(self, A, B, C):
		max_no = max(A, B, C)
		return max_no


class Solution:

	def greatestOfThree(self, A, B, C):
		out = A
		if B > out:
			out = B
		if C > out:
			out = C
		return out


class Solution:

	def greatestOfThree(self, A, B, C):
		l = [A, B, C]
		l.sort(reverse=True)
		return l[0]


class Solution:

	def greatestOfThree(self, A, B, C):
		d = []
		d.append(A)
		d.append(B)
		d.append(C)
		d.sort()
		return d[2]


class Solution:

	def greatestOfThree(self, A, B, C):
		k = []
		k.append(A)
		k.append(B)
		k.append(C)
		return max(k)


class Solution:

	def greatestOfThree(self, A, B, C):
		max_num = A
		if B > max_num:
			max_num = B
		if C > max_num:
			max_num = C
		return max_num


class Solution:

	def greatestOfThree(self, A, B, C):
		a = []
		a.append(A)
		a.append(B)
		a.append(C)
		a.sort()
		return a[-1]


class Solution:

	def greatestOfThree(self, A, B, C):
		list_1 = [A, B, C]
		return max(list_1)


class Solution:

	def greatestOfThree(self, A, B, C):
		max1 = max(A, B)
		return max(max1, C)