양의 정수가 주어졌을 때, 주어진 숫자가 회문이면 true를 반환하고, 그렇지 않으면 false를 반환하는 함수를 작성하세요. 예를 들어, 12321은 회문이지만 1451은 회문이 아닙니다.

권장 연습 Sum of Digit이 Pallindrome인지 아닌지 시도해 보세요!
방법 1:
주어진 숫자를 하나에 . 이 문제에 대한 간단한 방법은 먼저 의 역수 하나에 , 그 반대를 비교 하나에 ~와 함께 하나에 . 둘 다 동일하면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
다음은 방법#2에서 영감을 얻은 흥미로운 방법입니다. 이것 우편. 아이디어는 다음의 복사본을 만드는 것입니다. 하나에 참조로 복사본을 재귀적으로 전달하고 전달합니다. 하나에 가치로. 재귀 호출에서는 다음과 같이 나눕니다. 하나에 재귀 트리를 아래로 이동하는 동안 10씩 증가합니다. 재귀 트리를 위로 이동하면서 복사본을 10으로 나눕니다. 모든 하위 호출이 끝난 함수에서 만나면 하나에 복사의 마지막 자리는 끝에서부터 i번째 자리가 됩니다.
C++
// A recursive C++ program to check> // whether a given number> // is palindrome or not> #include> using> namespace> std;> > // A function that returns true only> // if num contains one> // digit> int> oneDigit(>int> num)> {> > >// Comparison operation is faster> >// than division> >// operation. So using following> >// instead of 'return num> >// / 10 == 0;'> >return> (num>= 0 && 숫자<10);> }> > // A recursive function to find> // out whether num is> // palindrome or not. Initially, dupNum> // contains address of> // a copy of num.> bool> isPalUtil(>int> num,>int>* dupNum)> {> > >// Base case (needed for recursion> >// termination): This> >// statement mainly compares the> >// first digit with the> >// last digit> >if> (oneDigit(num))> >return> (num == (*dupNum) % 10);> > >// This is the key line in this> >// method. Note that all> >// recursive calls have a separate> >// copy of num, but they> >// all share same copy of *dupNum.> >// We divide num while> >// moving up the recursion tree> >if> (!isPalUtil(num / 10, dupNum))> >return> false>;> > >// The following statements are> >// executed when we move up> >// the recursion call tree> >*dupNum /= 10;> > >// At this point, if num%10 contains> >// i'th digit from> >// beginning, then (*dupNum)%10> >// contains i'th digit> >// from end> >return> (num % 10 == (*dupNum) % 10);> }> > // The main function that uses> // recursive function> // isPalUtil() to find out whether> // num is palindrome or not> int> isPal(>int> num)> {> > >// Check if num is negative,> >// make it positive> >if> (num <0)> >num = -num;> > >// Create a separate copy of num,> >// so that modifications> >// made to address dupNum don't> >// change the input number.> >// *dupNum = num> >int>* dupNum =>new> int>(num);> > >return> isPalUtil(num, dupNum);> }> > // Driver program to test> // above functions> int> main()> {> >int> n = 12321;> >isPal(n) ? cout <<>'Yes
'>: cout <<>'No'> << endl;> > >n = 12;> >isPal(n) ? cout <<>'Yes
'>: cout <<>'No'> << endl;> > >n = 88;> >isPal(n) ? cout <<>'Yes
'>: cout <<>'No'> << endl;> > >n = 8999;> >isPal(n) ? cout <<>'Yes
'>: cout <<>'No'>;> >return> 0;> }> > // this code is contributed by shivanisinghss2110> |
>
>
씨
#include> #include> > // A function that returns true only> // if num contains one digit> int> oneDigit(>int> num)> {> >// Comparison operation is faster> >// than division operation.> >// So using the following instead of 'return num / 10 == 0;'> >return> (num>= 0 && 숫자<10);> }> > // A recursive function to find out whether> // num is palindrome or not.> // Initially, dupNum contains the address of a copy of num.> bool> isPalUtil(>int> num,>int>* dupNum)> {> >// Base case (needed for recursion termination):> >// This statement mainly compares the first digit with the last digit.> >if> (oneDigit(num))> >return> (num == (*dupNum) % 10);> > >// This is the key line in this method.> >// Note that all recursive calls have a separate copy of num,> >// but they all share the same copy of *dupNum.> >// We divide num while moving up the recursion tree.> >if> (!isPalUtil(num / 10, dupNum))> >return> false>;> > >// The following statements are executed when we move up the recursion call tree.> >*dupNum /= 10;> > >// At this point, if num % 10 contains the i'th digit from the beginning,> >// then (*dupNum) % 10 contains the i'th digit from the end.> >return> (num % 10 == (*dupNum) % 10);> }> > // The main function that uses the recursive function> // isPalUtil() to find out whether num is palindrome or not.> bool> isPal(>int> num)> {> >// Check if num is negative, make it positive.> >if> (num <0)> >num = -num;> > >// Create a separate copy of num, so that modifications> >// made to the address dupNum don't change the input number.> >int> dupNum = num;> > >return> isPalUtil(num, &dupNum);> }> > // Driver program to test above functions> int> main()> {> >int> n = 12321;> >isPal(n) ?>printf>(>'Yes
'>) :>printf>(>'No
'>);> > >n = 12;> >isPal(n) ?>printf>(>'Yes
'>) :>printf>(>'No
'>);> > >n = 88;> >isPal(n) ?>printf>(>'Yes
'>) :>printf>(>'No
'>);> > >n = 8999;> >isPal(n) ?>printf>(>'Yes
'>) :>printf>(>'No
'>);> > >return> 0;> }> |
>
>
자바
// A recursive Java program to> // check whether a given number> // is palindrome or not> import> java.io.*;> import> java.util.*;> > public> class> CheckPalindromeNumberRecursion {> > >// A function that returns true> >// only if num contains one digit> >public> static> int> oneDigit(>int> num) {> > >if> ((num>=>0>) && (num <>10>))> >return> 1>;> >else> >return> 0>;> >}> > >public> static> int> isPalUtil> >(>int> num,>int> dupNum)>throws> Exception {> > >// base condition to return once we> >// move past first digit> >if> (num ==>0>) {> >return> dupNum;> >}>else> {> >dupNum = isPalUtil(num />10>, dupNum);> >}> > >// Check for equality of first digit of> >// num and dupNum> >if> (num %>10> == dupNum %>10>) {> >// if first digit values of num and> >// dupNum are equal divide dupNum> >// value by 10 to keep moving in sync> >// with num.> >return> dupNum />10>;> >}>else> {> >// At position values are not> >// matching throw exception and exit.> >// no need to proceed further.> >throw> new> Exception();> >}> > >}> > >public> static> int> isPal(>int> num)> >throws> Exception {> > >if> (num <>0>)> >num = (-num);> > >int> dupNum = (num);> > >return> isPalUtil(num, dupNum);> >}> > >public> static> void> main(String args[]) {> > >int> n =>12421>;> >try> {> >isPal(n);> >System.out.println(>'Yes'>);> >}>catch> (Exception e) {> >System.out.println(>'No'>);> >}> >n =>1231>;> >try> {> >isPal(n);> >System.out.println(>'Yes'>);> >}>catch> (Exception e) {> >System.out.println(>'No'>);> >}> > >n =>12>;> >try> {> >isPal(n);> >System.out.println(>'Yes'>);> >}>catch> (Exception e) {> >System.out.println(>'No'>);> >}> > >n =>88>;> >try> {> >isPal(n);> >System.out.println(>'Yes'>);> >}>catch> (Exception e) {> >System.out.println(>'No'>);> >}> > >n =>8999>;> >try> {> >isPal(n);> >System.out.println(>'Yes'>);> >}>catch> (Exception e) {> >System.out.println(>'No'>);> >}> >}> }> > // This code is contributed> // by Nasir J> |
>
초기 무커
>
파이썬3
# A recursive Python3 program to check> # whether a given number is palindrome or not> > # A function that returns true> # only if num contains one digit> def> oneDigit(num):> > ># comparison operation is faster> ># than division operation. So> ># using following instead of> ># 'return num / 10 == 0;'> >return> ((num>>=> 0>)>and> >(num <>10>))> > # A recursive function to find> # out whether num is palindrome> # or not. Initially, dupNum> # contains address of a copy of num.> def> isPalUtil(num, dupNum):> > ># Base case (needed for recursion> ># termination): This statement> ># mainly compares the first digit> ># with the last digit> >if> oneDigit(num):> >return> (num>=>=> (dupNum[>0>])>%> 10>)> > ># This is the key line in this> ># method. Note that all recursive> ># calls have a separate copy of> ># num, but they all share same> ># copy of *dupNum. We divide num> ># while moving up the recursion tree> >if> not> isPalUtil(num>/>/>10>, dupNum):> >return> False> > ># The following statements are> ># executed when we move up the> ># recursion call tree> >dupNum[>0>]>=> dupNum[>0>]>/>/>10> > ># At this point, if num%10> ># contains i'th digit from> ># beginning, then (*dupNum)%10> ># contains i'th digit from end> >return> (num>%> 10> =>=> (dupNum[>0>])>%> 10>)> > # The main function that uses> # recursive function isPalUtil()> # to find out whether num is> # palindrome or not> def> isPal(num):> ># If num is negative,> ># make it positive> >if> (num <>0>):> >num>=> (>->num)> > ># Create a separate copy of> ># num, so that modifications> ># made to address dupNum> ># don't change the input number.> >dupNum>=> [num]># *dupNum = num> > >return> isPalUtil(num, dupNum)> > # Driver Code> n>=> 12321> if> isPal(n):> >print>(>'Yes'>)> else>:> >print>(>'No'>)> > n>=> 12> if> isPal(n) :> >print>(>'Yes'>)> else>:> >print>(>'No'>)> > n>=> 88> if> isPal(n) :> >print>(>'Yes'>)> else>:> >print>(>'No'>)> > n>=> 8999> if> isPal(n) :> >print>(>'Yes'>)> else>:> >print>(>'No'>)> > # This code is contributed by mits> |
>
>
씨#
// A recursive C# program to> // check whether a given number> // is palindrome or not> using> System;> > class> GFG> {> > // A function that returns true> // only if num contains one digit> public> static> int> oneDigit(>int> num)> {> >// comparison operation is> >// faster than division> >// operation. So using> >// following instead of> >// 'return num / 10 == 0;'> >if>((num>= 0) &&(숫자<10))> >return> 1;> >else> >return> 0;> }> > // A recursive function to> // find out whether num is> // palindrome or not.> // Initially, dupNum contains> // address of a copy of num.> public> static> int> isPalUtil(>int> num,> >int> dupNum)> {> >// Base case (needed for recursion> >// termination): This statement> >// mainly compares the first digit> >// with the last digit> >if> (oneDigit(num) == 1)> >if>(num == (dupNum) % 10)> >return> 1;> >else> >return> 0;> > >// This is the key line in> >// this method. Note that> >// all recursive calls have> >// a separate copy of num,> >// but they all share same> >// copy of *dupNum. We divide> >// num while moving up the> >// recursion tree> >if> (isPalUtil((>int>)(num / 10), dupNum) == 0)> >return> -1;> > >// The following statements> >// are executed when we move> >// up the recursion call tree> >dupNum = (>int>)(dupNum / 10);> > >// At this point, if num%10> >// contains i'th digit from> >// beginning, then (*dupNum)%10> >// contains i'th digit from end> >if>(num % 10 == (dupNum) % 10)> >return> 1;> >else> >return> 0;> }> > // The main function that uses> // recursive function isPalUtil()> // to find out whether num is> // palindrome or not> public> static> int> isPal(>int> num)> {> >// If num is negative,> >// make it positive> >if> (num <0)> >num = (-num);> > >// Create a separate copy> >// of num, so that modifications> >// made to address dupNum> >// don't change the input number.> >int> dupNum = (num);>// *dupNum = num> > >return> isPalUtil(num, dupNum);> }> > // Driver Code> public> static> void> Main()> {> int> n = 12321;> if>(isPal(n) == 0)> >Console.WriteLine(>'Yes'>);> else> >Console.WriteLine(>'No'>);> > n = 12;> if>(isPal(n) == 0)> >Console.WriteLine(>'Yes'>);> else> >Console.WriteLine(>'No'>);> > n = 88;> if>(isPal(n) == 1)> >Console.WriteLine(>'Yes'>);> else> >Console.WriteLine(>'No'>);> > n = 8999;> if>(isPal(n) == 0)> >Console.WriteLine(>'Yes'>);> else> >Console.WriteLine(>'No'>);> }> }> > // This code is contributed by mits> |
>
>
자바스크립트
> // A recursive javascript program to> // check whether a given number> // is palindrome or not> > >// A function that returns true> >// only if num contains one digit> >function> oneDigit(num) {> > >if> ((num>= 0) && (숫자<10))> >return> 1;> >else> >return> 0;> >}> > >function> isPalUtil> >(num , dupNum) {> > >// base condition to return once we> >// move past first digit> >if> (num == 0) {> >return> dupNum;> >}>else> {> >dupNum = isPalUtil(parseInt(num / 10), dupNum);> >}> > >// Check for equality of first digit of> >// num and dupNum> >if> (num % 10 == dupNum % 10) {> >// if first digit values of num and> >// dupNum are equal divide dupNum> >// value by 10 to keep moving in sync> >// with num.> >return> parseInt(dupNum / 10);> >}>else> {> >// At position values are not> >// matching throw exception and exit.> >// no need to proceed further.> >throw> e;> >}> > >}> > >function> isPal(num)> >{> > >if> (num <0)> >num = (-num);> > >var> dupNum = (num);> > >return> isPalUtil(num, dupNum);> >}> > > > >var> n = 1242;> >try> {> >isPal(n);> >document.write(>' Yes'>);> >}>catch> (e) {> >document.write(>' No'>);> >}> >n = 1231;> >try> {> >isPal(n);> >document.write(>' Yes'>);> >}>catch> (e) {> >document.write(>' No'>);> >}> > >n = 12;> >try> {> >isPal(n);> >document.write(>' Yes'>);> >}>catch> (e) {> >document.write(>' No'>);> >}> > >n = 88;> >try> {> >isPal(n);> >document.write(>' Yes'>);> >}>catch> (e) {> >document.write(>' No'>);> >}> > >n = 8999;> >try> {> >isPal(n);> >document.write(>' Yes'>);> >}>catch> (e) {> >document.write(>' No'>);> >}> > // This code is contributed by Amit Katiyar> > |
>
>
PHP
// A recursive PHP program to // check whether a given number // is palindrome or not // A function that returns true // only if num contains one digit function oneDigit($num) { // comparison operation is faster // than division operation. So // using following instead of // 'return num / 10 == 0;' return (($num>= 0) && ($num<10)); } // A recursive function to find // out whether num is palindrome // or not. Initially, dupNum // contains address of a copy of num. function isPalUtil($num, $dupNum) { // Base case (needed for recursion // termination): This statement // mainly compares the first digit // with the last digit if (oneDigit($num)) return ($num == ($dupNum) % 10); // This is the key line in this // method. Note that all recursive // calls have a separate copy of // num, but they all share same // copy of *dupNum. We divide num // while moving up the recursion tree if (!isPalUtil((int)($num / 10), $dupNum)) return -1; // The following statements are // executed when we move up the // recursion call tree $dupNum = (int)($dupNum / 10); // At this point, if num%10 // contains i'th digit from // beginning, then (*dupNum)%10 // contains i'th digit from end return ($num % 10 == ($dupNum) % 10); } // The main function that uses // recursive function isPalUtil() // to find out whether num is // palindrome or not function isPal($num) { // If num is negative, // make it positive if ($num <0) $num = (-$num); // Create a separate copy of // num, so that modifications // made to address dupNum // don't change the input number. $dupNum = ($num); // *dupNum = num return isPalUtil($num, $dupNum); } // Driver Code $n = 12321; if(isPal($n) == 0) echo 'Yes
'; else echo 'No
'; $n = 12; if(isPal($n) == 0) echo 'Yes
'; else echo 'No
'; $n = 88; if(isPal($n) == 1) echo 'Yes
'; else echo 'No
'; $n = 8999; if(isPal($n) == 0) echo 'Yes
'; else echo 'No
'; // This code is contributed by m_kit ?>> |
>
>산출
Yes No Yes No>
시간 복잡도: O(로그 n)
보조 공간: O(로그 n)
추가 공간을 사용하지 않고 숫자가 회문인지 아닌지 확인하려면
방법 2: string() 메소드 사용
- 해당 숫자의 자릿수가 10을 초과하는 경우18, long long int의 범위가 주어진 숫자를 만족하지 않기 때문에 해당 숫자를 정수로 사용할 수 없습니다.
- 따라서 입력을 문자열로 취하고 처음부터 길이/2까지 루프를 실행하고 첫 번째 문자(숫자)에서 문자열의 마지막 문자까지, 두 번째에서 두 번째 마지막 문자까지 확인하는 등의 작업을 수행합니다. 문자가 일치하지 않으면 문자열이 회문이 아닐 것입니다.
아래는 위의 접근 방식을 구현한 것입니다.
C++14
// C++ implementation of the above approach> #include> using> namespace> std;> > // Function to check palindrome> int> checkPalindrome(string str)> {> >// Calculating string length> >int> len = str.length();> > >// Traversing through the string> >// upto half its length> >for> (>int> i = 0; i // Comparing i th character // from starting and len-i // th character from end if (str[i] != str[len - i - 1]) return false; } // If the above loop doesn't return then it is // palindrome return true; } // Driver Code int main() { // taking number as string string st = '112233445566778899000000998877665544332211'; if (checkPalindrome(st) == true) cout << 'Yes'; else cout << 'No'; return 0; } // this code is written by vikkycirus> |
>
>
자바
// Java implementation of the above approach> import> java.io.*;> > class> GFG{> > // Function to check palindrome> static> boolean> checkPalindrome(String str)> {> > >// Calculating string length> >int> len = str.length();> > >// Traversing through the string> >// upto half its length> >for>(>int> i =>0>; i 2; i++) { // Comparing i th character // from starting and len-i // th character from end if (str.charAt(i) != str.charAt(len - i - 1)) return false; } // If the above loop doesn't return then // it is palindrome return true; } // Driver Code public static void main(String[] args) { // Taking number as string String st = '112233445566778899000000998877665544332211'; if (checkPalindrome(st) == true) System.out.print('Yes'); else System.out.print('No'); } } // This code is contributed by subhammahato348> |
>
>
파이썬3
# Python3 implementation of the above approach> > # function to check palindrome> def> checkPalindrome(>str>):> > ># Run loop from 0 to len/2> >for> i>in> range>(>0>,>len>(>str>)>/>/>2>):> >if> str>[i] !>=> str>[>len>(>str>)>->i>->1>]:> >return> False> > ># If the above loop doesn't> >#return then it is palindrome> >return> True> > > # Driver code> st>=> '112233445566778899000000998877665544332211'> if>(checkPalindrome(st)>=>=> True>):> >print>(>'it is a palindrome'>)> else>:> >print>(>'It is not a palindrome'>)> |
>
>
씨#
// C# implementation of the above approach> using> System;> > class> GFG{> > // Function to check palindrome> static> bool> checkPalindrome(>string> str)> {> > >// Calculating string length> >int> len = str.Length;> > >// Traversing through the string> >// upto half its length> >for>(>int> i = 0; i { // Comparing i th character // from starting and len-i // th character from end if (str[i] != str[len - i - 1]) return false; } // If the above loop doesn't return then // it is palindrome return true; } // Driver Code public static void Main() { // Taking number as string string st = '112233445566778899000000998877665544332211'; if (checkPalindrome(st) == true) Console.Write('Yes'); else Console.Write('No'); } } // This code is contributed by subhammahato348> |
>
>
자바스크립트
> > // Javascript implementation of the above approach> > // Function to check palindrome> function> checkPalindrome(str)> {> >// Calculating string length> >var> len = str.length;> > >// Traversing through the string> >// upto half its length> >for> (>var> i = 0; i // Comparing ith character // from starting and len-ith // character from end if (str[i] != str[len - i - 1]) return false; } // If the above loop doesn't return then it is // palindrome return true; } // Driver Code // taking number as string let st = '112233445566778899000000998877665544332211'; if (checkPalindrome(st) == true) document.write('Yes'); else document.write('No'); // This code is contributed by Mayank Tyagi> |
>
>산출
Yes>
시간 복잡도: 오(|str|)
보조 공간 : ㅇ(1)
방법 3:
다음은 숫자가 Palindrome인지 아닌지 확인하는 가장 간단한 방법입니다. 이 접근 방식은 주어진 숫자의 자릿수가 10^18보다 작을 때 사용할 수 있습니다. 왜냐하면 해당 숫자의 자릿수가 10^18을 초과하면 long long의 범위가 넓기 때문에 해당 숫자를 정수로 받아들일 수 없기 때문입니다. int가 주어진 숫자를 만족하지 않습니다.
주어진 숫자가 회문인지 아닌지를 확인하기 위해 주어진 숫자의 숫자를 뒤집어서 그 숫자의 반대가 원래 숫자와 같은지 확인합니다. 숫자의 반대가 해당 숫자와 같으면 숫자는 회문이 되고, 그렇지 않으면 회문이 아닙니다.
C++
// C++ program to check if a number is Palindrome> #include> using> namespace> std;> // Function to check Palindrome> bool> checkPalindrome(>int> n)> {> >int> reverse = 0;> >int> temp = n;> >while> (temp != 0) {> >reverse = (reverse * 10) + (temp % 10);> >temp = temp / 10;> >}> >return> (reverse> >== n);>// if it is true then it will return 1;> >// else if false it will return 0;> }> int> main()> {> >int> n = 7007;> >if> (checkPalindrome(n) == 1) {> >cout <<>'Yes
'>;> >}> >else> {> >cout <<>'No
'>;> >}> >return> 0;> }> // This code is contributed by Suruchi Kumari> |
>
>
자바
터보 C++ 다운로드
/*package whatever //do not write package name here */> > import> java.io.*;> > class> GFG {> >// Java program to check if a number is Palindrome> > >// Function to check Palindrome> >static> boolean> checkPalindrome(>int> n)> >{> >int> reverse =>0>;> >int> temp = n;> >while> (temp !=>0>) {> >reverse = (reverse *>10>) + (temp %>10>);> >temp = temp />10>;> >}> >return> (reverse == n);>// if it is true then it will return 1;> >// else if false it will return 0;> >}> > >// Driver Code> >public> static> void> main(String args[])> >{> >int> n =>7007>;> >if> (checkPalindrome(n) ==>true>) {> >System.out.println(>'Yes'>);> >}> >else> {> >System.out.println(>'No'>);> >}> >}> }> > // This code is contributed by shinjanpatra> |
>
>
파이썬3
# Python3 program to check if a number is Palindrome> > # Function to check Palindrome> def> checkPalindrome(n):> > >reverse>=> 0> >temp>=> n> >while> (temp !>=> 0>):> >reverse>=> (reverse>*> 10>)>+> (temp>%> 10>)> >temp>=> temp>/>/> 10> > >return> (reverse>=>=> n)># if it is true then it will return 1;> ># else if false it will return 0;> > # driver code> n>=> 7007> if> (checkPalindrome(n)>=>=> 1>):> >print>(>'Yes'>)> > else>:> >print>(>'No'>)> > # This code is contributed by shinjanpatra> |
>
>
씨#
// C# program to check if a number is Palindrome> > using> System;> > class> GFG {> > >// Function to check Palindrome> >static> bool> checkPalindrome(>int> n)> >{> >int> reverse = 0;> >int> temp = n;> >while> (temp != 0) {> >reverse = (reverse * 10) + (temp % 10);> >temp = temp / 10;> >}> >return> (> >reverse> >== n);>// if it is true then it will return 1;> >// else if false it will return 0;> >}> > >// Driver Code> >public> static> void> Main(>string>[] args)> >{> >int> n = 7007;> >if> (checkPalindrome(n) ==>true>) {> >Console.WriteLine(>'Yes'>);> >}> >else> {> >Console.WriteLine(>'No'>);> >}> >}> }> > // This code is contributed by phasing17> |
>
>
자바스크립트
> > // JavaScript program to check if a number is Palindrome> > // Function to check Palindrome> function> checkPalindrome(n)> {> >let reverse = 0;> >let temp = n;> >while> (temp != 0) {> >reverse = (reverse * 10) + (temp % 10);> >temp = Math.floor(temp / 10);> >}> >return> (reverse == n);>// if it is true then it will return 1;> >// else if false it will return 0;> }> > // driver code> > let n = 7007;> if> (checkPalindrome(n) == 1) {> >document.write(>'Yes'>,>''>);> }> else> {> >document.write(>'No'>,>''>);> }> > > // This code is contributed by shinjanpatra> > > |
>
>산출
Yes>
시간 복잡도: 오(로그10(n)) 또는 O(주어진 숫자의 자릿수)
보조 공간 : O(1) 또는 상수
이 기사는 다음에 의해 편집되었습니다.아시시 반왈.