Given a String str and the task is to check sum of ASCII value of all characters is a perfect square or not.
Input : ddddddddddddddddddddddddd Output : Yes Input : GeeksForGeeks Output : No
- Calculate the string length
- Calculate sum of ASCII value of all characters
- Take the square root of the number sum and store it into variable squareRoot
- Take floor value of the squareRoot and subtract from squareRoot
- If the difference of floor value of squareRoot and squareRoot is 0 then print “Yes” otherwise “No”
Below is the implementation of the above approach :
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Check if a number is a perfect square having all its digits as a perfect square
- Count numbers upto N which are both perfect square and perfect cube
- Check if a number is perfect square without finding square root
- Find minimum number to be divided to make a number a perfect square
- Check perfect square using addition/subtraction
- Number of times the largest perfect square number can be subtracted from N
- Largest number that is not a perfect square
- Check if given number is perfect square
- Permutation of numbers such that sum of two consecutive numbers is a perfect square
- Minimum digits to remove to make a number Perfect Square
- Check whether the number formed by concatenating two numbers is a perfect square or not
- Find the Next perfect square greater than a given number
- Largest factor of a given number which is a perfect square
- Count of pairs in an array whose sum is a perfect square
- Largest perfect square number in an Array
- Largest Divisor of a Number not divisible by a perfect square
- Closest perfect square and its distance
- Smallest perfect square divisible by all elements of an array
- Print n numbers such that their sum is a perfect square
- Check if product of array containing prime numbers is a perfect square
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.