Given an integer n representing number of vertices. Find out how many undirected graphs (not necessarily connected) can be constructed out of a given n number of vertices.
 
Example 1:
Input: 2
Output: 2
Example 2:
Input: 5
Output: 1024
 
Your Task:
Complete the function count() which takes an integer n as input and return the count of total number of graphs possible.
 
Expected Time Complexity: O(1)
Expected Space Complexity: O(1)
 
Constraints:
1<=n<=10

Source: geeksforgeeks | Difficulty: EASY

Starter code: #User function Template for python3



class Solution:

    def count(self, n):

        # Code here

Solutions:
class Solution:

	def count(self, n):
		if n == 2:
			return 2
		else:
			return 2 ** (n * (n - 1) // 2)


class Solution:

	def count(self, n):
		return 1 << n * (n - 1) // 2


class Solution:

	def count(self, n):
		return int(pow(2, n * (n - 1) / 2))


class Solution:

	def count(self, n):
		val = n * (n - 1) // 2
		return 1 << val
		ans = 0
		for i in range(n + 1):
			ans += self.calculateCombinations(n, i)
		return ans

	def calculateCombinations(self, n, r):
		fact_n = self.factorial(n)
		fact_r = self.factorial(r)
		fact_nr = self.factorial(n - r)
		return int(fact_n / (fact_r * fact_nr))

	def factorial(self, n):
		fact = 1
		for i in range(2, n + 1):
			fact *= i
		return fact


class Solution:

	def count(self, n):
		if n == 1:
			return n
		return int(2 ** (n * (n - 1) / 2))


class Solution:

	def count(self, n):
		x = n * (n - 1) // 2
		ans = 2 ** x
		return ans


class Solution:

	def count(self, n):
		x = int(n * (n - 1) // 2)
		return 2 ** x


class Solution:

	def count(self, n):
		ans = 2 ** (n * (n - 1) / 2)


import math

class Solution:

	def count(self, n):
		x = n * (n - 1) // 2
		return int(math.pow(2, x))


class Solution:

	def count(self, n):
		x = n * (n - 1) // 2
		return pow(2, x)


class Solution:

	def count(self, n):
		ans = n * (n - 1) / 2
		return int(2 ** ans)


class Solution:

	def count(self, n):
		sum = 1
		for i in range(1, n):
			sum *= pow(2, i)
		return sum


class Solution:

	def count(self, n):
		sum = n * (n - 1) / 2
		return int(2 ** sum)


class Solution:

	def count(self, n):
		N = n * (n - 1) / 2
		return int(2 ** N)


class Solution:

	def count(self, n):
		e = n * (n - 1) // 2
		return pow(2, e)


class Solution:

	def count(self, n):
		if n < 12:
			return int(2 ** (n * (n - 1) / 2))
		else:
			return -9223372036854775808