Tag: Length
-
How to find strings with no vowels in a file
This is the first solution to find all the strings with no vowels, in a given file. This approach uses the FileReader, BufferedReader, StringTokenizer and StringBuffer methods.
-
How to find and replace a given string with new string in a file
This is the first solution to find and replace a given string with a new string in a file. This approach uses the FileReader, BufferedReader, FileWriter, BufferedWriter, and StringBuffer methods.
-
How to reverse all the numbers in an array of integers
This is the first solution to reverse all the numbers. This solution modifies the same array. The resultant array has all the numbers reversed.
-
How to count number of occurrences of a given word in a file
This is the first solution to count the number of occurrences of a given word in the file. This approach uses the FileReader, BufferedReader, and string buffer methods.
-
How to check whether a number is Disarium or not
This is the second solution to check the number for Disarium. This solution contains the core logic to evaluate the sum of powers of all digits in descending order of the length of number. The Disarium number is say for a given number 351, evaluate the powers from the left side as power (3 *…
-
How to check whether a number is Armstrong number or not
This is the first solution to check the number for Armstrong. This solution uses String class, and a couple of Character functions to evaluate the sum of the cubes of each digit in a given number. The Armstrong number is say for a given number 153, evaluate the powers of cubes from any side as…
-
How to find Nth largest number in an array
This is the first solution to find the Nth largest number from an array of given numbers. This program uses the sort method of the Arrays class.
-
How to find subsets of a given string
This is the second solution to list all the subsets or substrings of a given string. This program does not use the substring method, instead uses the StringBuilder class append method.
-
How to find subsets of a given string
This is the first solution to list all the subsets or substrings of a given string. This uses the String’s class substring method for intermediate processing of all sized sub strings.
-
How to check whether a number is Disarium or not
This is the first solution to check the number for Disarium. This solution uses String class, and a couple of Character functions to evaluate the sum of powers. The Disarium number is say for a given number 351, evaluate the powers from the left side as power (3 * 1) + power (5 * 2)…
