Given an integer N, count the numbers having an odd number of factors from 1 to N (inclusive).
 
Example 1:
Input:
N = 5
Output:
2
Explanation:
From 1 - 5 only 2 numbers,
1 and 4 are having odd number
of factors.
Example 2:
Input:
N = 1
Output:
1
Explanation:
1 have only 1(odd)
factor
Your Task:
You don't need to read input or print anything. Your task is to complete the function count() which takes an integer N as input parameters and returns an integer, the total count of numbers from 1 to N having an odd number of factors.
 
Expected Time Complexity: O(sqrt(N))
Expected Space Complexity: O(1)
 
Constraints:
0 <= N <= 10^{9}

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3


class Solution:
    def count (self, N):
        # code here

Solutions:
import math

class Solution:

	def count(self, N):
		c = 0
		for i in range(1, N + 1):
			if i * i <= N:
				c += 1
		return c


import math

class Solution:

	def count(self, N):
		return math.floor(math.sqrt(N))


class Solution:

	def count(self, N):
		return int(N ** 0.5)


class Solution:

	def count(self, N):
		count_odd = 0
		for i in range(1, N + 1):
			if int(i ** 0.5) ** 2 == i:
				count_odd += 1
		return count_odd


from math import *

class Solution:

	def count(self, N):
		return int(N ** 0.5)


import math

class Solution:

	def count(self, N):
		return int(math.sqrt(N))


class Solution:

	def count(self, N):
		import math
		self.N = N
		p = math.sqrt(N)
		q = math.floor(p)
		return q


import math

class Solution:

	def count(self, N):
		(count, d) = (0, 0)
		for i in range(1, N + 1):
			d = int(math.sqrt(i))
			if i == d * d:
				count += 1
		return count


from math import sqrt

class Solution:

	def count(self, N):
		return int(sqrt(N))
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.count(N))


class Solution:

	def count(self, N):
		return int(N ** 0.5)
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.count(N))


class Solution:

	def count(self, N):
		N = N - 1
		start = 1
		end = N
		ans = 1
		while start <= end:
			mid = (start + end) // 2
			if mid * mid <= N:
				ans = mid
				start = mid + 1
			else:
				end = mid - 1
		return ans
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.count(N))


class Solution:

	def count(self, N):
		import math
		if N == 1:
			return 1
		count = 0
		for i in range(1, N):
			res = int(math.sqrt(i))
			if res * res == i:
				count += 1
		return count
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		print(ob.count(N))


class Solution:

	def count(self, N):
		c = 0
		for i in range(1, N + 1):
			if i ** 0.5 == int(i ** 0.5):
				c = c + 1
		return c


class Solution:

	def count(self, N):
		import math
		if N == 1:
			return 1
		else:
			return int(math.sqrt(N))


class Solution:

	def count(self, N):
		count = 0
		val = int(pow(N, 0.5))
		for i in range(1, val + 1):
			if i * i <= N:
				count += 1
		return count


import math

class Solution:

	def count(self, N):
		ar = [1]
		for i in range(2, N + 1):
			if math.sqrt(i) == int(math.sqrt(i)):
				ar.append(i)
		return len(ar)


import math

class Solution:

	def count(self, n):
		if n == 1:
			return 1
		return int(math.sqrt(n))


class Solution:

	def sqrt(self, N):
		l = 1
		r = N
		m = N // 2
		while l <= r:
			if m * m == N:
				return m
			elif m * m > N:
				r = m - 1
			else:
				l = m + 1
			m = (l + r) // 2
		return m

	def count(self, N):
		val = self.sqrt(N)
		return val


import math
from math import floor, ceil

class Solution:

	def count(self, N):
		return floor(math.sqrt(N))


class Solution:

	def count(self, N):
		import math
		c = 1
		for i in range(2, N + 1):
			if int(math.sqrt(i) * int(math.sqrt(i)) == i):
				c = c + 1
		return c


class Solution:

	def count(self, N):
		a = 0
		b = N
		return int(b ** 0.5) - int(a ** 0.5)


class Solution:

	def count(self, N):
		count1 = 0
		for i in range(1, N + 1):
			if i * i <= N:
				count1 += 1
		return count1


import math

class Solution:

	def count(self, N):
		c = 0
		if N == 1:
			return 1
		else:
			for i in range(1, N):
				if math.ceil(math.sqrt(i)) == math.floor(math.sqrt(i)):
					c += 1
		return c


from math import *

class Solution:

	def count(self, N):
		main_count = 0
		for i in range(1, N + 1):
			result = int(sqrt(i))
			if result * result == i:
				main_count += 1
		return main_count


class Solution:

	def count(self, N):
		fac = int(pow(N, 1 / 2))
		return fac


import math

class Solution:

	def count(self, n):
		return int(math.sqrt(n))


class Solution:

	def helper(self, n):
		sr = n ** 0.5
		m1 = sr % 1
		if m1 == 0:
			return True
		else:
			return False

	def count(self, N):
		ans = 1
		for i in range(2, N):
			if self.helper(i):
				ans += 1
		return ans


import math

class Solution:

	def count(self, N):
		count = 0
		for i in range(1, N + 1):
			square = i ** (1 / 2)
			if math.ceil(square) == math.floor(square):
				count += 1
		return count