Leetcode 25h August
Leetcode 25h August Sum of Square Numbers 이 문제는 a 2 + b 2 = c 가 존재하는지 체크 하는 로직입니다. This problem is checking whether has a condition values like a formula that a 2 + b 2 = c 이경우 저는 c - a 2 값을 저장한 DP 리스트를 만들고, for 문을 돌면서 math.sqrt가 정수인 값을 찾도록 있을 경우 True 없을 경우 False를 리턴하는 방식을 사용했습니다. in this case, i create one list named DP, in theirs they saved c - a 2 value until a * a <= c after that loop the dp and checking whether the square root of element is integer value or not Python class Solution : def judgeSquareSum ( self , c : int ) - > bool : dp = [ ] i = 0 j = 0 while i * i <= c : dp . append ( c - i * i ) i += 1 for x in dp : if math . sqrt ( x ) % 1 == 0 : return True return False